New submission from Charlie Yan <yanhao.char...@gmail.com>:
As described in the doc: https://docs.python.org/3.8/library/runpy.html#runpy.run_path > If the supplied path directly references a script file (whether as source or > as precompiled byte code), then __file__ will be set to the supplied path, > and __spec__, __cached__, __loader__ and __package__ will all be set to None. But: ``` $ cat a.py print(f'{__name__ = }') print(f'{__package__ = }') $ cat b.py import runpy runpy.run_path('a.py') $ python3 b.py __name__ = '<run_path>' __package__ = '' ``` `__package__` is not set to None as in the doc. ---------- messages: 414555 nosy: yanhao.charles priority: normal severity: normal status: open title: runpy.run_path didn't set __package__ as describe in doc versions: Python 3.8 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue46926> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com