Ronald Oussoren <ronaldousso...@mac.com> added the comment:

In Python 3.7.2:

>>> open(2, 'a')
<_io.TextIOWrapper name=2 mode='a' encoding='UTF-8'>
>>> m = _
>>> m.name
2
>>> type(_)
<class 'int'>

That is, when opening a file descriptor the name is set to the value of that 
file descriptor as an integer.

BTW. The implementation of PyFile_FromFd is a thin wrapper around the open 
function.

----------
nosy: +ronaldoussoren

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

Reply via email to