This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients chris.jerdonek, hynek, ncoghlan, pitrou
Date 2012-07-17.10:25:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1342520748.65.0.573430881122.issue15377@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2012-07-17 10:25:48ncoghlansetrecipients: + ncoghlan, pitrou, chris.jerdonek, hynek
2012-07-17 10:25:48ncoghlansetmessageid: <1342520748.65.0.573430881122.issue15377@psf.upfronthosting.co.za>
2012-07-17 10:25:48ncoghlanlinkissue15377 messages
2012-07-17 10:25:47ncoghlancreate