[issue30229] Closing a BufferedRandom calls lseek() mutliple times

2017-08-10 Thread STINNER Victor

STINNER Victor added the comment:

I closed my PR, so I also close this issue.

--
resolution:  -> rejected
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30229] Closing a BufferedRandom calls lseek() mutliple times

2017-05-03 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

READAHEAD uses read_end, RAW_OFFSET uses raw_pos. Are you sure that if 
READAHEAD(self) is zero RAW_OFFSET(self) is zero too?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30229] Closing a BufferedRandom calls lseek() mutliple times

2017-05-02 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +1493

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30229] Closing a BufferedRandom calls lseek() mutliple times

2017-05-02 Thread STINNER Victor

New submission from STINNER Victor:

Given the following snippet:

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

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.

--
components: IO
messages: 292749
nosy: haypo, pitrou, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Closing a BufferedRandom calls lseek() mutliple times
type: performance
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com