This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients pitrou, serhiy.storchaka, vstinner
Date 2017-05-02.12:17:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Given the following snippet:

    with open("x", "w+", encoding="utf-8") as fp:

Creating the TextIOWrapper object requires many syscall: see the issue #30228.

But I also noticed that *closing* such object also requires multiple lseek() syscalls, whereas the snippet doesn't read nor write anything.

Attached PR avoids lseek() if read and write buffers are empty.
Date User Action Args
2017-05-02 12:17:53vstinnersetrecipients: + vstinner, pitrou, serhiy.storchaka
2017-05-02 12:17:53vstinnersetmessageid: <>
2017-05-02 12:17:53vstinnerlinkissue30229 messages
2017-05-02 12:17:53vstinnercreate