[issue43297] bz2.open modes behaving differently than standard open() modes

2021-02-23 Thread Philipp Freyer
Philipp Freyer added the comment: I understand and accept that but I would recommend highlighting this difference in the documentation a bit more since this information can be easily skipped when reading the documentation. I still find it important to hint to this stronger since I've seen

[issue43297] bz2.open modes behaving differently than standard open() modes

2021-02-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with Josh and will mark this as closed. It is unfortunate, but the time to get an API right is before it lands, not years after people have come to depend on it. -- nosy: +rhettinger resolution: -> wont fix stage: -> resolved status:

[issue43297] bz2.open modes behaving differently than standard open() modes

2021-02-23 Thread Josh Rosenberg
Josh Rosenberg added the comment: All of the compression modules (gzip, lzma) have this behavior, not just bz2; it's consistent in that sense. Changing it now, after literally decades with the old behavior, would needlessly break existing programs. As you say, it's documented clearly, I'm

[issue43297] bz2.open modes behaving differently than standard open() modes

2021-02-22 Thread Philipp Freyer
New submission from Philipp Freyer : 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,