[docs] [issue32594] File object 'name' attribute inconsistent type and not obviously documented

Stéphane Wirtel report at bugs.python.org
Thu Jan 18 08:55:49 EST 2018

Stéphane Wirtel <stephane at wirtel.be> added the comment:

Hi Skip,

I only tested with the last revision of 2.7

Python 2.7.14+ (heads/2.7:b1a52b1167, Jan 18 2018, 14:53:29) 
[GCC 7.2.1 20170915 (Red Hat 7.2.1-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.stderr.name
>>> f = open(sys.stderr.fileno())
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: coercing to Unicode: need string or buffer, int found

I can't create a file with an int.

nosy: +matrixise

Python tracker <report at bugs.python.org>

More information about the docs mailing list