[issue1625576] add ability to specify name to os.fdopen

Antoine Pitrou report at bugs.python.org
Fri Nov 12 18:10:39 CET 2010


Antoine Pitrou <pitrou at free.fr> added the comment:

The requested feature would require an additional argument to fdopen() and open(), which already have many args. It would be better IMO to make the `name` attribute on file objects writeable.

By the way, right now (in 3.x) fdopen() gives you the file descriptor number, which is better than nothing:

>>> import os
>>> f = os.fdopen(2, "w")
>>> f
<_io.TextIOWrapper name=2 encoding='UTF-8'>

----------
nosy: +pitrou

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1625576>
_______________________________________


More information about the Python-bugs-list mailing list