Opened 13 years ago

Last modified 10 years ago

#8276 closed enhancement

PATCH: Python 2.4 compatibility. — at Version 9

Reported by: koeppj@… Owned by: Radek Bartoň
Priority: low Component: DiscussionPlugin
Severity: normal Keywords: patch
Cc: Trac Release: 0.11

Description (last modified by Ryan J Ollos)

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.

Change History (13)

Changed 13 years ago by anonymous

Attachment: api.py added

comment:1 Changed 13 years ago by koeppj@…

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.

comment:2 Changed 13 years ago by Radek Bartoň

Resolution: wontfix
Status: newclosed

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.

comment:3 Changed 13 years ago 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.

comment:4 in reply to:  3 Changed 13 years ago by Ryan J Ollos

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.

comment:5 Changed 13 years ago by koeppj@…

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

Changed 13 years ago by koeppj@…

Attachment: run_on_python_24.patch added

Patch to allow plugin to run on Python version 2.4

comment:6 Changed 13 years ago by Radek Bartoň

Keywords: patch added
Priority: normallow
Resolution: wontfix
Status: closedreopened
Summary: Compile Error of api.py for 0.11PATCH: Python 2.4 compatibility.
Type: defectenhancement

Thank you.

comment:7 Changed 13 years ago by Guido U. Draheim

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

Changed 13 years ago by Guido U. Draheim

Changed 13 years ago by Guido U. Draheim

comment:8 in reply to:  7 Changed 12 years ago 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)

comment:9 Changed 12 years ago by Ryan J Ollos

Description: modified (diff)
Note: See TracTickets for help on using tickets.