Bugs item #3158464, was opened at 2011-01-14 16:15
Message generated for change (Comment added) made by djbarrett
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=315846…
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: category
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Daniel Barrett (djbarrett)
Assigned to: Nobody/Anonymous (nobody)
Summary: category.py add crashes on redirect
Initial Comment:
If you run "python category.py add" for a page of links, and one link is a
redirect, category.py crashes with:
Traceback (most recent call last):
File "category.py", line 1188, in ?
main()
File "category.py", line 1141, in main
bot.run()
File "category.py", line 410, in run
self.treat(page)
File "category.py", line 480, in treat
text = self.load(page)
File "category.py", line 430, in load
redirTarget = pywikibot.Page(site, arg.args[0])
NameError: global name 'site' is not defined
$ python version.py
Pywikipedia [http] trunk/pywikipedia (r8824, 2011/01/14, 06:42:24)
Python 2.4.3 (#1, Nov 11 2010, 13:30:19)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-48)]
config-settings:
use_api = True
use_api_login = True
unicode test: ok
----------------------------------------------------------------------
Comment By: Daniel Barrett (djbarrett)
Date:
2011-01-14 16:52
Message:
The problem is absent prior to -r8493, when (according to the log message)
a "new class for the Add action" was used. In this older version,
redirects are noted and ignored, instead of crashing.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=315846…