[issue39365] Support (SEEK_END/SEEK_CUR) relative seeking in StringIO

2020-01-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a duplicate of issue25190. -- components: +Library (Lib) nosy: +serhiy.storchaka resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Define StringIO seek offset as code point offset type: behavior -> enhanceme

[issue39365] Support (SEEK_END/SEEK_CUR) relative seeking in StringIO

2020-01-19 Thread random832
random832 added the comment: That documentation isn't specific to StringIO, and in any case, the limitation in question isn't documented. The actual implementation is at https://github.com/python/cpython/blob/HEAD/Modules/_io/stringio.c#L484 But if examples would help, they're simple to come

[issue39365] Support (SEEK_END/SEEK_CUR) relative seeking in StringIO

2020-01-19 Thread sanket
sanket added the comment: can you provide more details? Python version and code/steps to reproduce. That'd be more helpful as it seems the methods are already implemented in latest version https://docs.python.org/3/library/io.html#io.TextIOBase.seek -- nosy: +sanketplus

[issue39365] Support (SEEK_END/SEEK_CUR) relative seeking in StringIO

2020-01-16 Thread random832
New submission from random832 : Currently this fails with a (misleading in the case of SEEK_END) "Can't do nonzero cur-relative seeks" error, but there's no conceptual reason it shouldn't be possible. The offset should simply be taken as a character offset, without any pretense that the "fil