This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients eryksun, saschanaz
Date 2020-04-23.20:10:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1587672643.77.0.719381619137.issue40368@roundup.psfhosted.org>
In-reply-to
Content
> `os.path.abspath(".")` returned 
> `'c:\\Users\\Kagami\\Documents\\GitHub\\gecko-dev'`. 
> Should `ntpath.normpaoh` make the drive letter uppercase?

ntpath.abspath and ntpath.normpath should preserve the input case for all components of a path because they don't query the system for the real path. On the other hand, ntpath.realpath in 3.8+ opens the path and queries the final path from the system. 

With drive-relative paths, ntpath.abspath does upper-case the drive letter. That's due to the underlying GutFullPathNameW call on Windows (an API function that normalizes a path as a string-only operation). We should just leave that up to Windows instead of trying to impose consistency. The behavior could be documented, however, along with other Windows behaviors such as per-drive working directories with drive-relative paths, DOS devices (e.g. "C:/Temp/con.txt" -> r"\\.\con") and stripping of trailing dots and spaces (e.g. "C:/Temp/spam. . ." -> r"C:\Temp\spam"). These cases make ntpath.abspath(path) more complicated than just the documented equivalent of ntpath.normpath(ntpath.join(os.getcwd(), path))` on "most platforms" (i.e. most POSIX platforms -- not Windows).
History
Date User Action Args
2020-04-23 20:10:43eryksunsetrecipients: + eryksun, saschanaz
2020-04-23 20:10:43eryksunsetmessageid: <1587672643.77.0.719381619137.issue40368@roundup.psfhosted.org>
2020-04-23 20:10:43eryksunlinkissue40368 messages
2020-04-23 20:10:43eryksuncreate