Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Closed
Description
Since6716254, attempting to create apathlib.PurePath orPath object with mixedstr andbytes arguments raises a TypeError (yay!) with a misleading message (booo!):
>>>importpathlib>>>pathlib.Path('foo',b'bar')TypeError:Can'tmixstringsandbytesinpathcomponents
This message implies that bytes are supported, as long as we don't mix them with strings. And yet when we try that:
>>>pathlib.Path(b'foo',b'bar')TypeError:argumentshouldbeastroranos.PathLikeobjectwhere__fspath__returnsastr,not'bytes'
This message is better, and should be used in the former case.