Page MenuHomePhabricator

DeprecationWarning: the imp module is deprecated in favour of importlib
Closed, ResolvedPublic

Description

$ python -We pwb.py
Traceback (most recent call last):
  File "pwb.py", line 187, in <module>
    import pywikibot
  File "...\pywikibot-core\pywikibot\__init__.py", line 65, in <module>
    from pywikibot.family import Family
  File "...\pywikibot-core\pywikibot\family.py", line 14, in <module>
    import imp
  File "...\Python\Python36\lib\imp.py", line 33, in <module>
    DeprecationWarning, stacklevel=2)
DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
<class 'DeprecationWarning'>
CRITICAL: Closing network session.

Details

Related Gerrit Patches:

Event Timeline

Dalba created this task.Feb 21 2017, 12:00 PM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptFeb 21 2017, 12:00 PM
Dalba claimed this task.Feb 21 2017, 12:06 PM

Change 338958 had a related patch set uploaded (by Dalba):
family.py: Use importlib instead of imp for Python 3.5

https://gerrit.wikimedia.org/r/338958

Change 338958 merged by jenkins-bot:
[pywikibot/core@master] family.py: Do not use the imp module in Python 3

https://gerrit.wikimedia.org/r/338958

Dalba closed this task as Resolved.Mar 25 2017, 1:30 PM