Ticket #8276 (reopened enhancement)

Opened 2 years ago

Last modified 8 months ago

PATCH: Python 2.4 compatibility.

Reported by: koeppj@koeppster.net Assigned to: Blackhex
Priority: low Component: DiscussionPlugin
Severity: normal Keywords: patch
Cc: Trac Release: 0.11

Description (Last modified by rjollos)

On build or install (python setup.py bdist_eng) I get the following error for a number of items. Start of log snippet

byte-compiling build/bdist.linux-x86_64/egg/tracdiscussion/api.py to api.pyc
  File "build/bdist.linux-x86_64/egg/tracdiscussion/api.py", line 1334
    'where' : 'WHERE ' + where if where else ''}
                                ^
SyntaxError: invalid syntax

Running this on RHEL 3.4 x64 with python 2.4 - revision 9598.

Attachments

api.py (76.0 kB) - added by anonymous on 12/06/10 23:34:18.
run_on_python_24.patch (6.1 kB) - added by koeppj@koeppster.net on 12/07/10 02:32:37.
Patch to allow plugin to run on Python version 2.4
trac-discussion-plugin.no-ifelse-api-01.patch (3.9 kB) - added by guidod on 08/18/11 22:12:28.
trac-discussion-plugin.no-ifelse-timeline-01.patch (478 bytes) - added by guidod on 08/18/11 22:13:12.

Change History

12/06/10 23:34:18 changed by anonymous

  • attachment api.py added.

12/06/10 23:36:28 changed by koeppj@koeppster.net

Realized this problem was due to use of python 2.5 inline conditionals. Suggest the docs get updated to indicate python 2.5 is a prereq or use the api.py I've addition.

12/07/10 02:20:37 changed by Blackhex

  • status changed from new to closed.
  • resolution set to wontfix.

Thank you for pointing this out. I'll mention it on the wiki page rather than fixing it. BTW: Attaching a patch would be more appreciated by potential users that has to use older Python versions.

(follow-up: ↓ 4 ) 12/07/10 02:24:52 changed by anonymous

Updated api.py is attached to this ticket. I'm not a python guru (I'm more a java guy) so I'm sure this is a more elegant way to fix but the api.py file attached to this ticket was compiled and runs on python 2.4. I'm note a registered user so can't create a proper patch.

(in reply to: ↑ 3 ) 12/07/10 02:29:31 changed by rjollos

Replying to anonymous:

I'm note a registered user so can't create a proper patch.

Registration is not required to checkout a project branch. You can then use svn diff and output to a file.

12/07/10 02:31:34 changed by koeppj@koeppster.net

Just realized that. Will upload one. Look for run_on_python_24.patch attached to this ticket.

12/07/10 02:32:37 changed by koeppj@koeppster.net

  • attachment run_on_python_24.patch added.

Patch to allow plugin to run on Python version 2.4

12/07/10 10:14:45 changed by Blackhex

  • status changed from closed to reopened.
  • resolution deleted.
  • summary changed from Compile Error of api.py for 0.11 to PATCH: Python 2.4 compatibility..
  • priority changed from normal to low.
  • keywords set to patch.
  • type changed from defect to enhancement.

Thank you.

(follow-up: ↓ 8 ) 08/18/11 22:11:33 changed by guidod

I am using the following patches for Python 2.4 compatibility:

trac-discussion-plugin/trac-discussion-plugin.no-ifelse-api-01.patch trac-discussion-plugin/trac-discussion-plugin.no-ifelse-timeline-01.patch

Prebuilt packages for CentOS-5 / RHEL5 can be downloaded from the Open Build Service at https://build.opensuse.org/package/show?package=trac-discussion-plugin&project=home%3Aguidod%3Atrac12

08/18/11 22:12:28 changed by guidod

  • attachment trac-discussion-plugin.no-ifelse-api-01.patch added.

08/18/11 22:13:12 changed by guidod

  • attachment trac-discussion-plugin.no-ifelse-timeline-01.patch added.

(in reply to: ↑ 7 ) 11/30/11 11:22:58 changed by dizzystreak

Replying to guidod:

I am using the following patches for Python 2.4 compatibility: trac-discussion-plugin/trac-discussion-plugin.no-ifelse-api-01.patch trac-discussion-plugin/trac-discussion-plugin.no-ifelse-timeline-01.patch Prebuilt packages for CentOS-5 / RHEL5 can be downloaded from the Open Build Service at https://build.opensuse.org/package/show?package=trac-discussion-plugin&project=home%3Aguidod%3Atrac12

Unfortunately, there is more python2.5 style code in the plugin. Here is an example error message with the line number:

TemplateSyntaxError: invalid syntax (/usr/lib/python2.4/site-packages/tracdiscussion/templates/discussion-macros.html, line 55)

12/02/11 10:41:20 changed by rjollos

  • description changed.

09/26/12 02:18:15 changed by rjollos

#9146 closed as a duplicate.

09/26/12 03:43:26 changed by rjollos

#8803 closed as a duplicate.

09/26/12 03:51:35 changed by rjollos

(In [12057]) Fixes #9963, Refs #9800, #8276, #8803, #9146: Added check in setup.py for minimum required Python version. Python 2.5 is currently required. Later, we'll aim to restore full Python 2.4 compatibility.


Add/Change #8276 (PATCH: Python 2.4 compatibility.)




Change Properties
Action