#7863 closed defect (fixed)
[patch] Syntax error found when building egg
Reported by: | stevek | Owned by: | Steffen Hoffmann |
---|---|---|---|
Priority: | high | Component: | AccountManagerPlugin |
Severity: | major | Keywords: | compatibility python2.4 |
Cc: | Ryan J Ollos | Trac Release: | 0.12 |
Description
When building the egg on our RHEL 5 server (w/ python version 2.4.3) via "python setup.py bdist_egg", I see the following in the byte-compiling section of the log:
byte-compiling build/bdist.linux-x86_64/egg/acct_mgr/htfile.py to htfile.pyc File "build/bdist.linux-x86_64/egg/acct_mgr/htfile.py", line 158 finally: ^ SyntaxError: invalid syntax
Even with this error, the egg is created.
Attachments (1)
Change History (12)
comment:1 follow-up: 2 Changed 14 years ago by
Cc: | Ryan J Ollos added; anonymous removed |
---|---|
Keywords: | compatibility python2.4 added |
comment:2 Changed 14 years ago by
Replying to hasienda:
Don't meant to offend you, but when will you have the chance to get the system in question pushed to a more recent state? In fact even very conservative Debian GNU/Linux current stable has Python2.5.2 . I thought, this would already be the absolute minimum, so I stand corrected here.
This is a frustration I've experienced with Red Hat Enterprise Linux as well. The latest version is Red Hat EL 5.5, and it is still running Python 2.4. You can point to another package repository such as DAG and get later versions of Python, but I imagine that this is allowed or desired by some administrators.
comment:3 Changed 14 years ago by
Severity: | normal → major |
---|---|
Status: | new → assigned |
Ok, exactly what I just found on my own as well. RHEL5 is old , but RHEL5.5 has been released only months ago. So we should still support it, nice to developers or not, who cares? After all, there's reasonable admin/user interest here.
Will try to do the change tomorrow and
1) attach a patch here, 2) wait for confirmation before 3) committing to trunk
comment:4 Changed 14 years ago by
Summary: | Syntax error found when building egg → [patch] Syntax error found when building egg |
---|
I couldn't sleep without at least trying a fix. Please review/test it. :-)
comment:6 follow-up: 8 Changed 14 years ago by
Replying to stevek:
The code compiles successfully. Thanks!!
You're welcome. Did you run the test suite as well as suggested before?
I'm not totally happy with this, but I see no other way as to loose part of code robustness to win Python2.4 compatibility. I don't say 'win back' for good reason here, as the offending try..finally
statements are in place for more than four(!) years now (i.e. see yourself in
http://trac-hacks.org/browser/accountmanagerplugin/trunk/acct_mgr/htfile.py?rev=3515#L101)
Anyway this may still prove to be a good move, since this is just again one potential issue less that users could stumble upon. Thank you for report and testing the fix.
comment:7 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
(In [9338]) AccountManagerPlugin: Defer introduction of new 'try..finally' statement, closes #7863.
I do want to finally support Python2.4 due to RHEL5.x still using it, as I see the trade-off of theoretically higher code robustness for definitely broader plugin availability as acceptable.
comment:8 Changed 14 years ago by
Replying to hasienda:
You're welcome. Did you run the test suite as well as suggested before?
Could you show me where to find the test suite?
comment:9 Changed 14 years ago by
Easy:
$> cd accountmanagerplugin/trunk $> python ./setup.py test (much output while running the unittests) OK $>
Replying to stevek:
Of course,
try..finally
syntax has been introduced to Python2.5, so this is actually about maintaining compatibility to Python2.4.But still this will cause a regression, since PasswordAuthStores can't work for you anymore with current trunk code added in changeset [9272].
In [9289] I've already removed compatibility code dedicated to Python2.3 . I'll have a look at the code at least before doing the next release to 0.11 branch, since even Trac 0.12 was maintained compatibility to Python2.4 .
But I hesitate to let trunk fall back into more complicated code just for this issue, as fixing PasswordAuthStores related code required a good amount of time and is already aiming at current Trac (0.13dev), where Python2.4 has been dropped recently for good measure. It's a nightmare to maintain such old program environments that effectively block reasonable progress (
with
statements being of major concern here).Don't meant to offend you, but when will you have the chance to get the system in question pushed to a more recent state? In fact even very conservative Debian GNU/Linux current stable has Python2.5.2 . I thought, this would already be the absolute minimum, so I stand corrected here.