Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-39379:sys.path[0] is already absolute path #18561

Merged
merged 5 commits into from
Feb 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions Doc/whatsnew/3.9.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,10 @@ Other Language Changes

* Python now gets the absolute path of the script filename specified on
the command line (ex: ``python3 script.py``): the ``__file__`` attribute of
the :mod:`__main__` module and ``sys.path[0]`` become an
absolute path, rather than a relative path. These paths now remain valid
after the current directory is changed by :func:`os.chdir`. As a side effect,
a traceback also displays the absolute path for :mod:`__main__` module frames
in this case.
the :mod:`__main__` module became an absolute path, rather than a relative
path. These paths now remain valid after the current directory is changed
by :func:`os.chdir`. As a side effect, the traceback also displays the
absolute path for :mod:`__main__` module frames in this case.
(Contributed by Victor Stinner in :issue:`20443`.)

* In the :ref:`Python Development Mode <devmode>` and in debug build, the
Expand Down