diff options
Diffstat (limited to 'Doc')
| -rw-r--r-- | Doc/whatsnew/3.9.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Doc/whatsnew/3.9.rst b/Doc/whatsnew/3.9.rst index 95e12ff851..b58c99b88d 100644 --- a/Doc/whatsnew/3.9.rst +++ b/Doc/whatsnew/3.9.rst @@ -75,6 +75,14 @@ New Features 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 ``__main__`` module, ``sys.argv[0]`` 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 ``__main__`` module frames in + this case. + (Contributed by Victor Stinner in :issue:`20443`.) New Modules |
