[Pywikipedia-bugs] [ pywikipediabot-Bugs-3419295 ] Python 2.4 incompatibile at wikipedia.py

SourceForge.net noreply at sourceforge.net
Thu Oct 6 03:14:56 UTC 2011


Bugs item #3419295, was opened at 2011-10-06 12:14
Message generated for change (Tracker Item Submitted) made by tmasao
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3419295&group_id=93107

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: None
Priority: 5
Private: No
Submitted By: Masao Takaku (tmasao)
Assigned to: Nobody/Anonymous (nobody)
Summary: Python 2.4 incompatibile at wikipedia.py

Initial Comment:
Hi,
I've been using pywikipediabot for maintenance of categories and geocoding etc at my wiki site for half a year.
Thanks for this nifty tool.

I'm using trunk HEAD of pywikipedia bot library for my own script.
I noticed several recent updates are incompatible for Python 2.4.

For example: my script stopped with the following error:
====
Traceback (most recent call last):
  File "createpage.py", line 22, in ?
    import wikipedia as pywikibot
  File "/home/masao/cvswork/savemlak/../pywikipedia/wikipedia.py", line 4422
    % (len(pages), u'via API ' if site.has_api() and debug else u'', site))
                                ^
SyntaxError: invalid syntax
===
Similar syntax error occurs at pywikibot/plural.py as well.

This error is caused by a new conditional expression introduced in Python 2.5.
cf. http://docs.python.org/whatsnew/2.5.html#pep-308

When I run my script under Python2.7, it works well.
If Python 2.4 is no longer supported, documentation is needed.

My running environment are as follows:
Pywikipedia [http] trunk/pywikipedia (r9587, 2011/10/05, 06:06:07)
  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

Best Regards,
Masao

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=3419295&group_id=93107



More information about the Pywikipedia-bugs mailing list