[issue39379] sys.path[0] is already absolute path

2020-02-29 Thread STINNER Victor


STINNER Victor  added the comment:

> Is sys.path[0] always absolute, or is it just a side-effect of the site 
> module (i.e. is it absolute even with -S)?

The absolute path is computed way before the site module is imported.

In Python 3.8, _PyPathConfig_ComputeSysPath0() computes sys.path[0] from 
sys.argv[0]. If the command line contains a script filename, this function uses 
realpath() on Unix and GetFullPathNameW() on Windows to get the absolute path. 
If -m is used, getcwd() is called.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39379] sys.path[0] is already absolute path

2020-02-29 Thread STINNER Victor


Change by STINNER Victor :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39379] sys.path[0] is already absolute path

2020-02-29 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

I have merged the doc change since it's minor. I will leave this open for 
clarification regarding Brett's question.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39379] sys.path[0] is already absolute path

2020-02-29 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:


New changeset 1f0cd3c61a5ae3aac5ebaccc75ae9828ca4f96c4 by Ananthakrishnan in 
branch 'master':
bpo-39379: Remove reference to sys.path[0] being absolute path in whatsnew 
(GH-18561)
https://github.com/python/cpython/commit/1f0cd3c61a5ae3aac5ebaccc75ae9828ca4f96c4


--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39379] sys.path[0] is already absolute path

2020-02-19 Thread Ananthakrishnan


Change by Ananthakrishnan :


--
keywords: +patch
pull_requests: +17941
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/18561

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39379] sys.path[0] is already absolute path

2020-01-20 Thread Brett Cannon


Brett Cannon  added the comment:

Is sys.path[0] always absolute, or is it just a side-effect of the site module 
(i.e. is it absolute even with -S)?

--
nosy: +brett.cannon

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39379] sys.path[0] is already absolute path

2020-01-19 Thread STINNER Victor


STINNER Victor  added the comment:

Correct, it seems like sys.path[0] was already absolute and so it can be 
removed from What's New in Python 3.9.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39379] sys.path[0] is already absolute path

2020-01-18 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39379] sys.path[0] is already absolute path

2020-01-17 Thread Ken Sato

New submission from Ken Sato :

In the "What’s New In Python 3.9" (Doc/whatsnew/3.9.rst), it says

> 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 and sys.path[0] become an absolute path, rather than a relative path.

However, I believe sys.path[0] is already absolute path since the previous 
versions. We can probably remove "and sys.path[0]" from the phrase to avoid 
possible confusions.

--
assignee: docs@python
components: Documentation
messages: 360239
nosy: docs@python, ksato9700
priority: normal
severity: normal
status: open
title: sys.path[0] is already absolute path
versions: Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com