Page MenuHomePhabricator

Python 3.5 is not able to solve circular imports like Python 3.6+ do
Closed, ResolvedPublicBUG REPORT


List of steps to reproduce (step by step, including full links if applicable):

from import deprecated_args
or any other import from tools to

Waht happens:*

16:08:11 fasttest-py35 run-test: commands[0] | python -W error::UserWarning -m pwb generate_user_files -family:wikipedia -lang:test -v
16:08:11 [147] /src$ /src/.tox/fasttest-py35/bin/python -W error::UserWarning -m pwb generate_user_files -family:wikipedia -lang:test -v
16:08:12 Traceback (most recent call last):
16:08:12   File "/usr/lib/python3.5/", line 193, in _run_module_as_main
16:08:12     "__main__", mod_spec)
16:08:12   File "/usr/lib/python3.5/", line 85, in _run_code
16:08:12     exec(code, run_globals)
16:08:12   File "/src/", line 272, in <module>
16:08:12     import pywikibot as pwb
16:08:12   File "/src/pywikibot/", line 21, in <module>
16:08:12     from pywikibot import config as _config
16:08:12   File "/src/pywikibot/", line 62, in <module>
16:08:12     from pywikibot.logging import error, output, warning
16:08:12   File "/src/pywikibot/", line 36, in <module>
16:08:12     from import deprecated_args
16:08:12   File "/src/pywikibot/tools/", line 31, in <module>
16:08:12     import pywikibot.logging as _pylogging
16:08:12 AttributeError: module 'pywikibot' has no attribute 'logging'

Software version:

Event Timeline

Change 785386 had a related patch set uploaded (by Xqt; author: Xqt):

[pywikibot/core@master] [bugfix] import pywikibot as a whole in tools/

Xqt claimed this task.

Change 785386 merged by Xqt:

[pywikibot/core@master] [bugfix] import pywikibot as a whole in tools/