Shashwat Anand <[email protected]> added the comment:
Following the documentation,
os.path.normcase(path)
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.
On Windows, it also converts forward slashes to backward slashes.
on Mac OS X,
>>> import os
>>> os.name
'posix'
Checking through, Lib/posixpath.py,
# Normalize the case of a pathname. Trivial in Posix, string.lower on Mac.
# On MS-DOS this may also turn slashes into backslashes; however, other
# normalizations (such as optimizing '../' away) are not allowed
# (another function should be defined to do that).
def normcase(s):
"""Normalize case of pathname. Has no effect under Posix"""
# TODO: on Mac OS X, this should really return s.lower().
return s
Why on Mac OS X, it should return s.lower() ?
Also to raise Error for None case we can probably change normcase() in
Lib/posixpath.py as,
def normcase(s):
"""Normalize case of pathname. Has no effect under Posix"""
if s is None:
raise AttributeError
return s
----------
nosy: +l0nwlf
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue9018>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com