#3351 closed defect (fixed)
trac 0.9.5 not worked with python 2.5b1
| Reported by: | anonymous | Owned by: | Matthew Good |
|---|---|---|---|
| Priority: | lowest | Milestone: | 0.9.7 |
| Component: | general | Version: | 0.9.5 |
| Severity: | minor | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: | |||
| API Changes: | |||
| Internal Changes: | |||
Description (last modified by )
su-3.00# trac-admin
Traceback (most recent call last):
File "/usr/local/bin/trac-admin", line 21, in <module>
from trac.scripts.admin import run
File "/usr/local/lib/python2.5/site-packages/trac/scripts/admin.py", line 17
from __future__ import generators
SyntaxError: from __future__ imports must occur at the beginning of the file
Attachments (0)
Change History (7)
comment:1 by , 19 years ago
| Description: | modified (diff) |
|---|---|
| Milestone: | → 0.9.6 |
| Owner: | changed from to |
| Priority: | normal → lowest |
| Severity: | normal → minor |
comment:3 by , 19 years ago
comment:4 by , 19 years ago
There are no __future__ statements in trunk AFAICT, so this doesn't apply to trunk. And as cboos said, we're not likely to fix this on 0.9-stable because you're more likely to upgrade Trac (pretty simple) than Python (not so much).
follow-up: 6 comment:5 by , 19 years ago
OK, I agree with you to not fix it for 0.9.X but I think that new release ( 0.10 and so on ) will need that easy fix.
Anyway, the problem is not releate to __future__ but as you can see to the patch that I have attached to #3377 the error is generated by the line 15 of file trac/scripts/admin.py that is:
__copyright__ = 'Copyright (c) 2003-2006 Edgewall Software'
Let me know what you think
Stefano "Kismet" Lenzi
comment:6 by , 19 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
Replying to kismet.sl@gmail.com:
Anyway, the problem is not releate to
__future__but as you can see to the patch that I have attached to #3377 the error is generated by the line 15 of file trac/scripts/admin.py that is:
(summarizing our discussion on IRC): This is specific to importing from __future__ since it's a special module used to change the behavior of the Python parser. So, since it will affect the parsing of the rest of the module, the __future__ imports need to occur before other code.
This fix is so trivial I'll go ahead and commit it, but I think cboos and cmlenz are right that if there's much work needed to make Trac 0.9.x compatible with Python 2.5 it's not really worth it since 0.10 should be done before the Python release is finalized.



If you're willing to test the bleeding edge Python version, you should also have little problems trying out the latest of Trac (0.10dev), which is quite stable now (at least r3502, before the last bunch of Mimeview related refactorings).