Nick Coghlan <[email protected]> added the comment:
I'd be more inclined to tighten up the check for the "can't mix" message to
something like:
valid_types = all(isinstance(s, (str, bytes, bytearray)) for s in (a, ) + p)
if valid_types:
# Must have a mixture of text and binary data
raise TypeError("Can't mix strings and bytes in path components.")
raise
If people pass in something that isn't a valid argument *at all*, then I'm fine
with just letting the underlying exception pass through.
The str/bytes case is just worth special-casing because either on their own
*are* valid arguments.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue15377>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com