Page MenuHomePhabricator

'Maximum retries' exception is not Python 3 compatible
Closed, InvalidPublic


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 request error handling is organised.

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/", line 367, in raw_decode
    obj, end = self.scan_once(s, idx)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/home/travis/build/wikimedia/pywikibot-core/pywikibot/data/", line 606, in submit
    result = json.loads(rawdata)
  File "/opt/python/3.3.5/lib/python3.3/json/", line 316, in loads
    return _default_decoder.decode(s)
  File "/opt/python/3.3.5/lib/python3.3/json/", 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/", 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/", line 331, in testLinkMethods
  File "/home/travis/build/wikimedia/pywikibot-core/pywikibot/", line 2582, in pagebacklinks
  File "/home/travis/build/wikimedia/pywikibot-core/pywikibot/", line 2568, in pagebacklinks
    for redir in redirgen:
  File "/home/travis/build/wikimedia/pywikibot-core/pywikibot/data/", line 1095, in __iter__ = self.request.submit()
  File "/home/travis/build/wikimedia/pywikibot-core/pywikibot/data/", line 828, in submit
    self._data = super(CachedRequest, self).submit()
  File "/home/travis/build/wikimedia/pywikibot-core/pywikibot/data/", line 624, in submit
  File "/home/travis/build/wikimedia/pywikibot-core/pywikibot/data/", line 711, in wait
    raise TimeoutError("Maximum retries attempted without success.") Maximum retries attempted without success.

Version: core-(2.0)
Severity: normal



Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:56 AM
bzimport set Reference to bz72603.
bzimport added a subscriber: Unknown Object (????).
jayvdb created this task.Oct 28 2014, 4:23 AM
XZise triaged this task as Lowest priority.Jan 18 2015, 8:54 PM
XZise added a subscriber: XZise.

I'm not sure this is a valid bug. Yes three tracebacks look more intimidating, but if we show that any unfamiliar will be intimidated no matter if only the last or all three are shown.

If it's changed it shouldn't be Python 3 specific but work on both versions and then something like that it only prints the error message to the console and the traceback to a log. Problem with that solution however is when the log wasn't activated because than the traceback is lost.

XZise updated the task description. (Show Details)Jan 18 2015, 8:55 PM
XZise set Security to None.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJul 18 2015, 6:01 PM

I don't think this is a bug either. In fact, IMO this helps a lot in debugging when you want to understand the exact code paths

Xqt closed this task as Invalid.Aug 3 2018, 7:28 PM
Xqt added a subscriber: Xqt.

See comments above