Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #119 (closed defect: fixed)

Opened 14 years ago

Last modified 12 years ago

[PATCH] Python 2.3 compatibility

Reported by: anonymous Owned by: anonymous
Priority: normal Milestone: 0.9
Component: TurboGears Version:
Severity: normal Keywords: 2.3
Cc:

Description

Here's my current patch to make the trunk version of TurboGears work with Python 2.3. It does the following:

  • Change setup.py to require 2.3 instead of 2.4
  • Changes all uses of decorators to "fn = decorate(fn)"
  • Adds an "import Set as set, ImmutableSet? as frozenset" to those modules using set and frozenset when they're not available as builtins
  • Wraps attempts to change fn.func_name so that the TypeError? exception thrown by 2.3 can be ignored
  • Changes the generator expressions in identity/provider/soprovider.py into list comprehensions

Outstanding issues:

  • The use of threading.local() in identity/init.py. I can provide a patch to add Python 2.4's _threading_local.py implementation and use that when needed, but it was suggested that cherrypy.request could be used instead. I'm not yet familiar enough with the identity code to be confident making those changes without any unit tests, so I've left it for now.
  • Paste and PasteScript (used by command/quickstart.py) use string.Template and the subprocess module, which are 2.4 features. I can provide a patch to quickstart.py to make these features available under 2.3, but I'll try and get the problem solved upstream first.

Attachments

turbogears-py2.3.diff Download (29.8 KB) - added by Paul Clifford 14 years ago.
Python 2.3 compatiblity
turbogears-toolbox-py2.3.diff Download (1.1 KB) - added by Paul Clifford 14 years ago.
Fix use of decorators

Change History

Changed 14 years ago by Paul Clifford

Python 2.3 compatiblity

comment:1 Changed 14 years ago by kevin

  • Status changed from new to closed
  • Resolution set to fixed

committed in [119]. Thanks!

comment:2 Changed 14 years ago by kevin

  • Milestone set to 0.9

comment:3 Changed 14 years ago by Paul Clifford

  • Status changed from closed to reopened
  • Resolution fixed deleted

A recent checkin to turbogears/toolbox/shell.py contained decorators, here's another patch to make the code Python 2.3 compatible.

Changed 14 years ago by Paul Clifford

Fix use of decorators

comment:4 Changed 14 years ago by Paul Clifford

  • Keywords 2.3 added

I've opened a new ticket (#131) to fix the use of threading.local() by moving identity under cherrypy.request as suggested. A combination of these two patches should make revision 200 fully Python 2.3 compatible.

comment:5 Changed 14 years ago by Luca <luca@…>

  • Summary changed from Patch for Python 2.3 compatibility to [PATCH] Python 2.3 compatibility

So, #131 is closed now, should this ticket be closed too?

comment:6 Changed 14 years ago by kevin

  • Status changed from reopened to closed
  • Resolution set to fixed

This ticket is done. If there are further 2.3 issues, they should appear in a new ticket. (I know everything I've been checking in has been 2.3 friendly.)

Note: See TracTickets for help on using tickets.