Ronald Oussoren <ronaldousso...@mac.com> added the comment:
This is expected behaviour: When your run a script the directory containing the script is added to the start of sys.path. Running "python3.6 a/foo.py" therefore adds "a" to the start of sys.path, and "math.py" then shadows the stdlib module "math". This has nothing to do with absolute imports. That is shown by "python3.6 -m foo.a". This runs the code in foo/a.py as module foo.a, and "math.py" is now only accessible as "foo.math" (it won't shadow the builtin module "math", even if you add "import math" to foo/a.py). ---------- resolution: -> not a bug status: open -> pending _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue34414> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com