diff options
Diffstat (limited to 'Lib/macpath.py')
-rw-r--r-- | Lib/macpath.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/macpath.py b/Lib/macpath.py index 3b3e4ff071..1615d9122a 100644 --- a/Lib/macpath.py +++ b/Lib/macpath.py @@ -32,6 +32,9 @@ def _get_colon(path): # Normalize the case of a pathname. Dummy in Posix, but <s>.lower() here. def normcase(path): + if not isinstance(path, (bytes, str)): + raise TypeError("normcase() argument must be str or bytes, " + "not '{}'".format(path.__class__.__name__)) return path.lower() @@ -199,4 +202,4 @@ def realpath(path): pass return path -supports_unicode_filenames = False +supports_unicode_filenames = True |