Serhiy Storchaka added the comment:
And the name attribute of FileIO object is writable. So you can change it after
calling fdopen.
import os
f = os.fdopen(2, w)
f
_io.TextIOWrapper name=2 mode='w' encoding='UTF-8'
f.buffer.raw.name = 'useful name'
f
_io.TextIOWrapper name='useful name'
Changes by Christian Heimes li...@cheimes.de:
--
status: open - languishing
versions: +Python 3.4 -Python 3.2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1625576
___
Antoine Pitrou pit...@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
Collin Winter coll...@gmail.com added the comment:
Christian: yes, that sounds fine.
--
assignee: collinwinter -
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1625576
___
Georg Brandl ge...@python.org added the comment:
Collin: I doubt Christian will do much about this anymore :)
--
nosy: +georg.brandl
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1625576
___
Changes by Terry J. Reedy tjre...@udel.edu:
--
versions: +Python 3.2 -Python 2.7, Python 3.1
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1625576
___
Changes by Daniel Diniz aja...@gmail.com:
--
stage: - test needed
versions: +Python 2.7, Python 3.1 -Python 2.6
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1625576
___
Christian Heimes added the comment:
Where is the patch, Mark?
Collin, does fdopen(fd[, mode[, bufsize[, msg=None]]]) and open file
'fdopen \d+ (msg)' sound good to you?
--
assignee: - collinwinter
nosy: +tiran
versions: +Python 2.6
_
Tracker [EMAIL