[issue40391] io.FileIO.mode doesn't comply with the docs

2020-10-02 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It is a duplicate of issue25341. -- nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> File mode wb+ appears as rb+ ___ Python tracker

[issue40391] io.FileIO.mode doesn't comply with the docs

2020-10-02 Thread Irit Katriel
Irit Katriel added the comment: The mode string is calculated here: https://github.com/python/cpython/blob/master/Modules/_io/fileio.c#L1055 and is based on these four values in the fileio struct: unsigned int created : 1; unsigned int readable : 1; unsigned int writable : 1;

[issue40391] io.FileIO.mode doesn't comply with the docs

2020-04-25 Thread mike.parker
New submission from mike.parker : io.FileIO.mode doesn't reflect "The mode as given in the constructor." as per the documentation(https://docs.python.org/3/library/io.html#io.FileIO.mode). Was noted in issue4362, but seems to be still relevant. Example: >>> f = open("t.tmp", "w+b") >>> f.mode