Serhiy Storchaka <[email protected]> added the comment:
I checked out. Files opened in "utf-8-sig" are seekable.
>>> open('test', 'w', encoding='utf-8-sig').write('qwerty\nйцукен\n')
>>> open('test', 'r', encoding="utf-8").read()
'\ufeffqwerty\nйцукен\n'
>>> open('test', 'r', encoding="utf-8-sig").read()
'qwerty\nйцукен\n'
>>> with open('test', 'r', encoding="utf-8-sig") as f:
... print(ascii(f.readline()))
... f.seek(0)
... print(ascii(f.readline()))
...
'qwerty\n'
0
'qwerty\n'
Should this issue be closed?
----------
nosy: +storchaka
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue7185>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com