[issue39840] FileNotFoundError et al show b-prefix on filepaths if passed as bytes

2020-03-03 Thread Eric V. Smith


Eric V. Smith  added the comment:

That behavior is consistent with other exceptions. It's a helpful piece of 
information if you were to see it in a traceback, without any other context. So 
this is by design.

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
type:  -> behavior

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue39840] FileNotFoundError et al show b-prefix on filepaths if passed as bytes

2020-03-03 Thread Augie Fackler


New submission from Augie Fackler :

I'm not really sure if this is a bug per se, so please feel encouraged to close 
as WAI if you like, but:

>>> open(b'foo', 'rb')
Traceback (most recent call last):
  File "", line 1, in 
FileNotFoundError: [Errno 2] No such file or directory: b'foo'

Seems a little weird to me (and it shows up in the UI layer of hg), because the 
path-as-bytes seems like it shouldn't show up in the human-readable version of 
the exception (I think I would have expected the fsdecode() of the bytes, for 
consistency?)

But that's up to you. If the presentation format of this feels right to Python 
that's no big deal.

--
messages: 363297
nosy: durin42
priority: normal
severity: normal
status: open
title: FileNotFoundError et al show b-prefix on filepaths if passed as bytes
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com