[New-bugs-announce] [issue43297] bz2.open modes behaving differently than standard open() modes

Philipp Freyer report at bugs.python.org
Mon Feb 22 12:03:22 EST 2021


New submission from Philipp Freyer <philipp.freyer at dilcher.de>:

The documentation clearly states that bz2.open(mode='r') opens a file in binary mode. I would have to use 'rt' for text mode.

The basic Python open(mode='r') method opens a file in text mode.
This is how I would expect any open(mode='r') method to work, especially since the standard Python implementation of open() treats 'r' as a synonym to 'rt'.

IMHO the behavior of bz2.open() is a possible pitfall for many developers and should be in line with the standard open() behavior.

Sorry, if this is in the wrong place, I am happy to put this elsewhere. However, I do see that as a conceptual issue (in our case this bug was not found for years)

----------
messages: 387517
nosy: philipp.freyer
priority: normal
severity: normal
status: open
title: bz2.open modes behaving differently than standard open() modes
type: behavior
versions: Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43297>
_______________________________________


More information about the New-bugs-announce mailing list