Page MenuHomePhabricator

ModuleDeprecationWrapper is not compatible with the feature 'autoreload' in ipython
Open, Needs TriagePublic

Description

ModuleDeprecationWrapper is not compatible with the feature 'autoreload' in ipython.

I.e., if a module is changed during a session in ipython repl, the following happens when ipython tries to 'autoreload' the module

[autoreload of pywikibot.page failed: Traceback (most recent call last):
  File "/home/myuser/anaconda3/lib/python3.7/site-packages/IPython/extensions/autoreload.py", line 245, in check
    superreload(m, reload, self.old_objects)
  File "/home/myuser/anaconda3/lib/python3.7/site-packages/IPython/extensions/autoreload.py", line 434, in superreload
    module = reload(module)
  File "/home/myuser/anaconda3/lib/python3.7/imp.py", line 314, in reload
    return importlib.reload(module)
  File "/home/myuser/anaconda3/lib/python3.7/importlib/__init__.py", line 142, in reload
    name = module.__spec__.name
  File "/home/myuser/python/core/pywikibot/tools/__init__.py", line 1984, in __getattr__
    if attr in self._deprecated:
  File "/home/myuser/python/core/pywikibot/tools/__init__.py", line 1984, in __getattr__
    if attr in self._deprecated:
  File "/home/myuser/python/core/pywikibot/tools/__init__.py", line 1984, in __getattr__
    if attr in self._deprecated:
  [Previous line repeated 3 more times]
RecursionError: maximum recursion depth exceeded while calling a Python object

Event Timeline

Mpaa created this task.Nov 9 2019, 9:38 PM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptNov 9 2019, 9:38 PM