Eryk Sun <eryk...@gmail.com> added the comment:

> single dots are collapsed

For pathlib, I've previously discussed a desire to retain a leading dot 
component from the initializing path. This could be implemented in strict mode 
for normpath(). 

A leading dot is significant in the path of an executable in a search context, 
such as the first item in the args sequence of subprocess.Popen(). For example, 
if "./spam" is normalized as "spam", then the system will search the PATH 
directories instead of the current working directory. It's also import to note 
that in Windows a leading dot component is required in order to preclude 
searching even if the path contains slashes. For example, CreateProcessW() and 
SearchPathW() will try to resolve r"spam\eggs.exe" against every directory in 
the search path, whereas r".\spam\eggs.exe" is explicitly relative to just the 
current working directory.

Retaining a leading dot component can also be important in Windows in order to 
disambiguate a drive-relative path from a named data stream of a file that has 
a single-letter filename. For example, "C:spam" is a file named "spam" in the 
working path on drive "C:" (e.g. "C:spam" -> r"C:\working\path\spam"), but 
r".\C:spam" is a data stream named "spam" in a file named "C" in the current 
working directory.

----------
nosy: +eryksun

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue44316>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to