[issue7145] UTF-16 BOM is not written by socket.makefile (but is expected by read)
Antoine Pitrou added the comment: Indeed, I would suggest won't fix. -- resolution: - wont fix status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7145 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7145] UTF-16 BOM is not written by socket.makefile (but is expected by read)
Serhiy Storchaka added the comment: Won't fix? -- nosy: +serhiy.storchaka status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7145 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7145] UTF-16 BOM is not written by socket.makefile (but is expected by read)
Antoine Pitrou pit...@free.fr added the comment: The explanation is that sockets are not seekable, but the heuristic to decide whether to write a BOM relies on tell() to return 0 on start-of-file. If we unconditionally wrote a BOM, there would be a risk of duplicate BOMs depending on the use case, which is more annoying than lacking a BOM at the beginning. -- components: +IO nosy: +pitrou priority: - normal ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7145 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7145] UTF-16 BOM is not written by socket.makefile (but is expected by read)
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7145 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7145] UTF-16 BOM is not written by socket.makefile (but is expected by read)
New submission from Yang Zhang yaa...@gmail.com: When I call s.makefile('r',encoding='utf-16').read(), this expects a BOM, but s.makefile('w',encoding='utf-16').write('hello') doesn't produce it. This is asymmetric. BTW is there a way to prevent the reading file from expecting a BOM? -- components: Library (Lib) messages: 94108 nosy: yang severity: normal status: open title: UTF-16 BOM is not written by socket.makefile (but is expected by read) type: behavior versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7145 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7145] UTF-16 BOM is not written by socket.makefile (but is expected by read)
Yang Zhang yaa...@gmail.com added the comment: To answer my own question: specify UTF-16BE or UTF-16LE -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7145 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com