zhuyifei1999 added a comment.
The command is site.upload(imagePage, source_filename=path, comment=self.summary, ignore_warnings=ignore) where imagePage is a pywikibot.Page, path is an ascii string, self.summary is an ascii string ignore is False
A KeyboardInterrupt during the wait shows:
WARNING: Waiting 40 seconds before retrying. ^CTraceback (most recent call last): File "flickrAZ.py", line 194, in <module> main() File "flickrAZ.py", line 190, in main bot.run() File "flickrAZ.py", line 178, in run self.parsePages() File "flickrAZ.py", line 72, in parsePages self.parsePhoto(photo) File "flickrAZ.py", line 133, in parsePhoto self.upload(imagePage, fileURL, name, False) File "flickrAZ.py", line 153, in upload site.upload(imagePage, source_filename=path, comment=self.summary, ignore_warnings=ignore) File "/data/project/yifeibot/pywikibot/pywikibot/tools/__init__.py", line 950, in wrapper return obj(*__args, **__kw) File "/data/project/yifeibot/pywikibot/pywikibot/site.py", line 4969, in upload result = req.submit() File "/data/project/yifeibot/pywikibot/pywikibot/data/api.py", line 1579, in submit self.wait() File "/data/project/yifeibot/pywikibot/pywikibot/data/api.py", line 1710, in wait time.sleep(self.retry_wait) KeyboardInterrupt
As for Python 3, it gives "ImportError: No module named 'urllib2'". I'm not sure if I can run it
TASK DETAIL https://phabricator.wikimedia.org/T99366
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: zhuyifei1999 Cc: XZise, Aklapper, zhuyifei1999, jayvdb, pywikipedia-bugs