valhallasw added a comment.
It should log to stdout, yes. For example:
import httplib2 httplib2.debuglevel = 4 import pywikibot pywikibot.Page(pywikibot.Site(), 'test')
connect: (en.wikipedia.org, 443) send: u'GET /w/api.php?maxlag=5&continue=&format=json&meta=siteinfo%7Cuserinfo&action=query&siprop=namespaces%7Cnamespacealiases%7Cgeneral&uiprop=blockinfo%7Chasmsg HTTP/1.1\r\nHost: en.wikipedia.org\r\nconnection: keep-alive\r\ncontent-type: application/x-www-form-urlencoded\r\naccept-encoding: gzip, deflate\r\nuser-agent: (wikipedia:en; User:Valhallasw) Pywikibot/2.0b3 (g5524) httplib2/0.9 Python/2.7.6.final.0\r\n\r\n' reply: 'HTTP/1.1 200 OK\r\n' ... etc.
but it's possible the exception occurs earlier.
Can you provide the exact values you pass to
site.upload(imagePage, source_filename=path, comment=self.summary, ignore_warnings=ignore)
and the original file? That could help in reproducing the issue.
TASK DETAIL https://phabricator.wikimedia.org/T99366
EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/
To: zhuyifei1999, valhallasw Cc: valhallasw, XZise, Aklapper, zhuyifei1999, jayvdb, pywikipedia-bugs