diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-06-25 10:56:11 +0000 |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-06-25 10:56:11 +0000 |
commit | 5a3ef5b22af607666111c76764db0efffbef82be (patch) | |
tree | 68e3601264f88350017f6bd0a77c9b46b0237e52 /Lib/posixpath.py | |
parent | 6186bfb735c90c22035d8b29a0e97ae39bd12d5b (diff) | |
download | cpython-git-5a3ef5b22af607666111c76764db0efffbef82be.tar.gz |
#9018: os.path.normcase() now raises a TypeError if the argument is not str or bytes.
Diffstat (limited to 'Lib/posixpath.py')
-rw-r--r-- | Lib/posixpath.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/posixpath.py b/Lib/posixpath.py index 5783975e4a..667f5c52de 100644 --- a/Lib/posixpath.py +++ b/Lib/posixpath.py @@ -49,6 +49,9 @@ def _get_sep(path): def normcase(s): """Normalize case of pathname. Has no effect under Posix""" # TODO: on Mac OS X, this should really return s.lower(). + if not isinstance(s, (bytes, str)): + raise TypeError("normcase() argument must be str or bytes, " + "not '{}'".format(s.__class__.__name__)) return s |