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

2018-01-20 Thread R. David Murray
R. David Murray added the comment: Ah, yes. When I said "this has been discussed previously", that's the issue I was thinking of but couldn't find. -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> State clearly that open()

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

2018-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Isn't this a duplicate of issue18534? -- nosy: +serhiy.storchaka ___ Python tracker

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

2018-01-18 Thread R. David Murray
R. David Murray added the comment: I believe you are correct that it is too late to modify the existing behavior. Too many programs depend on it. As far as documenting, my point is that it is *not specified* what the name attribute contains. It can contain literally

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

2018-01-18 Thread Skip Montanaro
Skip Montanaro added the comment: I'm not terribly concerned with the end result, only that we wind up with a more consistent system. As I see it, there are two main problems: 1. The type of the name attribute varies 2. The name attribute appears to be undocumented,

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

2018-01-18 Thread Skip Montanaro
Skip Montanaro added the comment: Apologies for the incomplete report. In 2.7 this anomaly exists in the io.open() function. You are correct, builtin open() in 2.x doesn't support opening by file descriptor. -- ___ Python

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

2018-01-18 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: Maybe we could add in the documentation. """ if we use a file descriptor as the parameter, the name of the returned file object will be the file descriptor itself. """ -- ___ Python tracker

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

2018-01-18 Thread R. David Murray
R. David Murray added the comment: This has been discussed previously. The nature of the 'name' attribute for file objects is not really specified, so I'm not even sure what we would document. Maybe just that it is unspecified. -- nosy: +r.david.murray

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

2018-01-18 Thread Stéphane Wirtel
Change by Stéphane Wirtel : -- versions: -Python 2.7 ___ Python tracker ___ ___

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

2018-01-18 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: but I can confirm your issue with 3.6.4+ Python 3.6.4+ (heads/3.6:f31c70b0d6, Jan 18 2018, 14:57:01) [GCC 7.2.1 20170915 (Red Hat 7.2.1-2)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>>

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

2018-01-18 Thread Stéphane Wirtel
Stéphane Wirtel 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. >>>

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

2018-01-18 Thread Skip Montanaro
New submission from Skip Montanaro : I stumbled on what I think is an inconsistency in the "name" attribute of file objects. When a file is opened with an existing file descriptor, the "name" attribute is of type int (this from a 3.6.4 session, but it also exists in