New submission from Gianluca <gianluca.gippe...@gmail.com>:

When bz2 and lzma files are used in writing text mode (wrapped in a 
TextIOWrapper), the BOM of encodings such as utf-16 and utf-32 is not written. 
The gzip package works as expected (it writes the BOM).

The code that demonstrate this behavior (tested with Python 3.7) is attached 
here and can also be found on stackoverflow: 
https://stackoverflow.com/questions/55171439/python-bz2-and-lzma-in-mode-wt-dont-write-the-bom-while-gzip-does-why?noredirect=1#comment97103212_55171439

----------
components: IO
files: demonstrate_BOM_issue.py
messages: 337987
nosy: janluke
priority: normal
severity: normal
status: open
title: When using bz2 and lzma in mode 'wt', the BOM is not written
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48209/demonstrate_BOM_issue.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36304>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to