Message108208
| Author |
l0nwlf |
| Recipients |
ezio.melotti, giampaolo.rodola, l0nwlf, pitrou, r.david.murray |
| Date |
2010年06月19日.20:00:53 |
| SpamBayes Score |
2.2948294e-05 |
| Marked as misclassified |
No |
| Message-id |
<1276977655.35.0.854993397938.issue9018@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
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 |
|