Message292759
I don't like PR 1385. abs_pos is a private attribute used only in _io._Buffered.seek() for readable streams when whence is SEEK_SET or SEEK_CUR. There is no guarantee that it contains relevant value for non-readable stream.
You could call buffer.seek(0, SEEK_CUR) rather than buffer.tell() for avoiding a system call for readable stream. But this looks as a shamanism too.
Or provide a function similar to the RAW_TELL macro but just checking if the current position is 0. If define it in bufferedio.c near _buffered_raw_tell() it is more chance that it is consistent with abs_pos and future changes don't break it. |
|
Date |
User |
Action |
Args |
2017-05-02 13:56:48 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, pitrou, vstinner |
2017-05-02 13:56:48 | serhiy.storchaka | set | messageid: <1493733408.46.0.774043431149.issue30228@psf.upfronthosting.co.za> |
2017-05-02 13:56:48 | serhiy.storchaka | link | issue30228 messages |
2017-05-02 13:56:48 | serhiy.storchaka | create | |
|