[issue26318] `io.open(fd, ...).name` returns numeric fd instead of None

2016-02-12 Thread Марк Коренберг
Марк Коренберг added the comment: The main idea: if wile does not have a name, it should not have it! -- ___ Python tracker ___

[issue26318] `io.open(fd, ...).name` returns numeric fd instead of None

2016-02-12 Thread Марк Коренберг
Марк Коренберг added the comment: 1. nasty bugs not in my code! 2. It is not documented that name may be an int, so if applications rely on undocumented stuff are definitely broken, so if IMHO we CAN change that. 3. It will be much stricter to delattr('name') instead of setting as None. This

[issue26318] `io.open(fd, ...).name` returns numeric fd instead of None

2016-02-12 Thread Марк Коренберг
Марк Коренберг added the comment: oops, issue22208 is not related issue -- ___ Python tracker ___ ___

[issue26318] `io.open(fd, ...).name` returns numeric fd instead of None

2016-02-12 Thread Terry J. Reedy
Terry J. Reedy added the comment: 3.4 only gets security fixes. 3.5 only gets bug fixes. Feature changes ('enhancements') are limited to future versions. This is not a behavior issue because the code and doc match. https://docs.python.org/3/library/io.html#io.FileIO.name says (as Martin

[issue26318] `io.open(fd, ...).name` returns numeric fd instead of None

2016-02-10 Thread STINNER Victor
STINNER Victor added the comment: Hum, I don't think that it can be changed today. io.open(int).name is an int since Python 2.6. Changing it may break applications for a little benefit. > `io.open(fd, ...).name` returns numeric fd instead of None. This lead to some > nasty bugs. Why do you

[issue26318] `io.open(fd, ...).name` returns numeric fd instead of None

2016-02-09 Thread Марк Коренберг
Марк Коренберг added the comment: In particular, `io.open(fd, ...)` can not be used with tarfile, since it use it's "name" property, and think that it is real file name, and not expecte it to be int. -- ___ Python tracker

[issue26318] `io.open(fd, ...).name` returns numeric fd instead of None

2016-02-09 Thread Martin Panter
Martin Panter added the comment: I agree that the business with “name” is a mess. I don’t know what the best solution is. FileIO.name is already documented as being a file descriptor in some cases. Perhaps we should document that the Buffered and Text wrappers inherit the wrapped name, but

[issue26318] `io.open(fd, ...).name` returns numeric fd instead of None

2016-02-09 Thread Марк Коренберг
Марк Коренберг added the comment: in any case, passing INTEGER as name is wrong thing, since (due to duck typing), name should be a string. -- ___ Python tracker

[issue26318] `io.open(fd, ...).name` returns numeric fd instead of None

2016-02-08 Thread Марк Коренберг
New submission from Марк Коренберг: `io.open(fd, ...).name` returns numeric fd instead of None. This lead to some nasty bugs. In order to bring consistency and make that predictable, please make `.name` for that case to return None. (and document it) -- components: IO, Library (Lib)