Message165696
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. |
|
Date |
User |
Action |
Args |
2012-07-17 10:25:48 | ncoghlan | set | recipients:
+ ncoghlan, pitrou, chris.jerdonek, hynek |
2012-07-17 10:25:48 | ncoghlan | set | messageid: <1342520748.65.0.573430881122.issue15377@psf.upfronthosting.co.za> |
2012-07-17 10:25:48 | ncoghlan | link | issue15377 messages |
2012-07-17 10:25:47 | ncoghlan | create | |
|