Filipe Laíns <la...@riseup.net> added the comment:

Okay.

Having a better look at it, I think we should only add this specification to 
open().

Traversable, by design, makes it totally plausible that open() cannot be 
performed. It could be a nonexistent path, the Traversable could represent 
object where open() does not make sense given the underlying implementation 
(it's something that cannot be read), etc.

If Traversable makes it possible for open() to not work, it should give us a 
mechanism to handle such situations.
If the only thing I know about an object is that it implements Traversable, how 
can I use open() in a reliable manner without having my code explode?

This mechanism does not need to be FileNotFoundError. But, in my opinion, it is 
what probably makes the most sense in this case. Please let me know if you have 
a different/better idea.

----------

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

Reply via email to