Issue 23079: os.path.normcase documentation confusing (original) (raw)

Created on 2014-12-18 12:02 by chris.jerdonek, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (6)
msg232871 - (view) Author: Chris Jerdonek (chris.jerdonek) * (Python committer) Date: 2014-12-18 12:02
The documentation for os.path.normcase(path) is currently confusing or self-contradictory. Currently, it reads-- "Normalize the case of a pathname. On Unix and Mac OS X, this returns the path unchanged; on case-insensitive filesystems, it converts the path to lowercase." However, with a case-insensitive file system on Mac OS X (e.g. "File System Personality: Journaled HFS+"), normcase() does not convert paths to lowercase. As it stands, it seems like the clause "on case-insensitive filesystems, it converts the path to lowercase" should be removed or further qualified. I don't know what the qualification is though.
msg232872 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-12-18 12:16
s/on case-insensitive filesystems/on Windows/ ?
msg232873 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-12-18 12:18
... and OS/2 (in 2.7).
msg232879 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-12-18 14:17
Or would s/case-insensitive/not case-preserving/ be more accurate? (Well, you'd probably rewrite the sentence to eliminate the 'not').
msg232881 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2014-12-18 14:46
> Or would s/case-insensitive/not case-preserving/ be more accurate? (Well, > you'd probably rewrite the sentence to eliminate the 'not'). This would not be more accurate because behavior depends from OS, not from file system. On Unix/Linux your can mount case-insensitive filesystem, but normcase() doesn't know anything about this.
msg396242 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-06-21 12:57
This has been fixed by now: https://docs.python.org/3/library/os.path.html#os.path.normpath
History
Date User Action Args
2022-04-11 14:58:11 admin set github: 67268
2021-06-21 12:57:25 iritkatriel set status: open -> closednosy: + iritkatrielmessages: + resolution: fixedstage: resolved
2014-12-18 14:46:41 serhiy.storchaka set messages: +
2014-12-18 14:17:33 r.david.murray set nosy: + r.david.murraymessages: +
2014-12-18 12🔞34 serhiy.storchaka set messages: +
2014-12-18 12:16:09 serhiy.storchaka set nosy: + serhiy.storchakamessages: +
2014-12-18 12:02:11 chris.jerdonek create