Guido van Rossum <gu...@python.org> added the comment:

Agreed it's too subtle to change the behavior.

> We may also want to explicitly point out that using os.fsdecode(name) before 
> passing it to open() will ensure that the name attribute is set to a string 
> rather than a bytes object.

Not sure. Are there cases where os.fsdecode() fails even if the binary syscall 
would succeed? (The docs claim that on Windows it uses 'strict'.)

If it doesn't, maybe we can add a new attribute that gives the name as Text? It 
could be '' if name is an int.

----------
nosy: +gvanrossum
status: pending -> open

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue18534>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to