https://bugzilla.wikimedia.org/show_bug.cgi?id=72603
Bug ID: 72603 Summary: 'Maximum retries' api.py exception is not Python 3 compatible Product: Pywikibot Version: core (2.0) Hardware: All OS: All Status: NEW Severity: normal Priority: Unprioritized Component: network Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: jayvdb@gmail.com Web browser: --- Mobile Platform: ---
In this py3 build, there are some network issues, and py3 exception handling shows three exceptions, including json decoding exceptions. The result is confusing to someone unfamiliar with py3 or not intimately aware of how the api.py request error handling is organised.
https://travis-ci.org/wikimedia/pywikibot-core/jobs/39178815
====================================================================== ERROR: testLinkMethods (tests.site_tests.TestSiteObject) Test site methods for getting links to and from a page. ---------------------------------------------------------------------- Traceback (most recent call last): File "/opt/python/3.3.5/lib/python3.3/json/decoder.py", line 367, in raw_decode obj, end = self.scan_once(s, idx) StopIteration During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/travis/build/wikimedia/pywikibot-core/pywikibot/data/api.py", line 606, in submit result = json.loads(rawdata) File "/opt/python/3.3.5/lib/python3.3/json/__init__.py", line 316, in loads return _default_decoder.decode(s) File "/opt/python/3.3.5/lib/python3.3/json/decoder.py", line 351, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/opt/python/3.3.5/lib/python3.3/json/decoder.py", line 369, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/home/travis/build/wikimedia/pywikibot-core/tests/site_tests.py", line 331, in testLinkMethods filterRedirects=False)) File "/home/travis/build/wikimedia/pywikibot-core/pywikibot/site.py", line 2582, in pagebacklinks content=content File "/home/travis/build/wikimedia/pywikibot-core/pywikibot/site.py", line 2568, in pagebacklinks for redir in redirgen: File "/home/travis/build/wikimedia/pywikibot-core/pywikibot/data/api.py", line 1095, in __iter__ self.data = self.request.submit() File "/home/travis/build/wikimedia/pywikibot-core/pywikibot/data/api.py", line 828, in submit self._data = super(CachedRequest, self).submit() File "/home/travis/build/wikimedia/pywikibot-core/pywikibot/data/api.py", line 624, in submit self.wait() File "/home/travis/build/wikimedia/pywikibot-core/pywikibot/data/api.py", line 711, in wait raise TimeoutError("Maximum retries attempted without success.") pywikibot.data.api.TimeoutError: Maximum retries attempted without success.