Skip to content
Commit b19d7e7a authored by Zbigniew Jędrzejewski-Szmek's avatar Zbigniew Jędrzejewski-Szmek Committed by Chris Lamb
Browse files

Replace codecs.open with a simplified reimplementation

python 3.14 doesn't like codecs.open:

tests/test_readers.py: 1 warning
/builddir/build/BUILD/diffoscope-303-build/diffoscope-303/diffoscope/comparators/text.py:44: DeprecationWarning: codecs.open() is deprecated. Use open() instead.
   ) as my_content, codecs.open(
...

In most scenarios, codecs.open and builtins.open are equivalent.
Unfortunately, the case where the file is opened for reading, 'b' is not
used in the mode, and an encoding is specified, results in a difference
in behaviour: whitespace is handled differently.

To avoid the warning, add a trivial reimplementation.
parent d1251804
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment