Modify

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#7863 closed defect (fixed)

[patch] Syntax error found when building egg

Reported by: stevek Owned by: hasienda
Priority: high Component: AccountManagerPlugin
Severity: major Keywords: compatibility python2.4
Cc: rjollos 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)

fx_7863.patch (2.7 KB) - added by hasienda 4 years ago.
draft for needed patch

Download all attachments as: .zip

Change History (12)

comment:1 in reply to: ↑ description ; follow-up: Changed 4 years ago by hasienda

  • Cc rjollos added
  • Keywords compatibility python2.4 added

Replying to stevek:

When building the egg on our RHEL 5 server (w/ python version 2.4.3) ![...]

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

Of course, try..finally syntax has been introduced to Python2.5, so this is actually about maintaining compatibility to Python2.4.

Even with this error, the egg is created.

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.

comment:2 in reply to: ↑ 1 Changed 4 years ago by rjollos

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 4 years ago by hasienda

  • Severity changed from normal to major
  • Status changed from new to 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

Changed 4 years ago by hasienda

draft for needed patch

comment:4 Changed 4 years ago by hasienda

  • Summary changed from Syntax error found when building egg to [patch] Syntax error found when building egg

I couldn't sleep without at least trying a fix. Please review/test it. :-)

comment:5 follow-up: Changed 4 years ago by stevek

The code compiles successfully. Thanks!!

comment:6 in reply to: ↑ 5 ; follow-up: Changed 4 years ago by hasienda

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 4 years ago by hasienda

  • Resolution set to fixed
  • Status changed from assigned to 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 in reply to: ↑ 6 Changed 4 years ago by stevek

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 4 years ago by hasienda

Easy:

$> cd accountmanagerplugin/trunk
$> python ./setup.py test
(much output while running the unittests)

OK
$> 

comment:10 Changed 4 years ago by stevek

Test suite passed all 26 tests!!

comment:11 Changed 4 years ago by hasienda

Very good. Seems all well done now.

Add Comment

Modify Ticket

Action
as closed The owner will remain hasienda.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.