Bugs item #3433609, was opened at 2011-11-04 10:49
Message generated for change (Comment added) made by djbarrett
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=343360…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: Wont Fix
Priority: 5
Private: No
Submitted By: Daniel Barrett (djbarrett)
Assigned to: xqt (xqt)
Summary: Patch 3419295 did not fix python 2.4 compatibility
Initial Comment:
After the change from 3419295, there is still a syntax error:
sudo python redirect.py double
Traceback (most recent call last):
File "redirect.py", line 66, in ?
import wikipedia as pywikibot
File "/usr/local/pywikipedia/wikipedia.py", line 142, in ?
from pywikibot import *
File "/usr/local/pywikipedia/pywikibot/__init__.py", line 16, in ?
from i18n import translate
File "/usr/local/pywikipedia/pywikibot/i18n.py", line 14, in ?
from plural import plural_rules
File "/usr/local/pywikipedia/pywikibot/plural.py", line 17
0 if (n == 0) else
^
SyntaxError: invalid syntax
$ python version.py
Pywikipedia [http] trunk/pywikipedia (r9725, 2011/11/04, 14:50:26)
Python 2.4.3 (#1, Sep 21 2011, 19:55:41)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-51)]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date:
2011-11-07 06:50
Message:
Thanks. If you are deprecating Python 2.4 officially, could you please
document your recommended version number that is the most stable and works
with 2.4?
If you don't have access to a 2.4 system I would be happy to help. Just
send me a list of POSSIBLE version numbers and I will let you know which
ones break.
----------------------------------------------------------------------
Comment By: Merlijn S. van Deen (valhallasw)
Date: 2011-11-07 04:46
Message:
However, please feel free to submit a patch that fully fixes 2.4
compatibility. The problem is neither xqt nor me have access to a python
2.4 install anymore, so it's very hard for us to fix it.
Unfortunately, it's not possible to use a __future__ import for this - the
operators will have to be rewritten:
a if b else c -> [c,a][b] - even though this is horrible in terms of
readability. Please mark the locations you change it with a comment with
the original ternary operator, and possible a fixed #IIF mark, or something
like that (so it could be removed in the future).
----------------------------------------------------------------------
Comment By: xqt (xqt)
Date: 2011-11-06 20:54
Message:
Depends i18n PLURAL support of some scripts and I won't fix since python
2.4 had it last fix more than 3 years ago and we should declare it as
deprecated release for pywikibot support. Upuntu itself no longer bundles
2.4. Please update to 2.7.2 if possible or use an older pywikibot release.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=343360…