From 470e3b94a82ab7a834783498279ca3a9d228599a Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Mon, 20 Jul 2020 14:54:17 +0100 Subject: [PATCH 1/2] Fail tests if bytes/bytearray are interpolated into str. --- .ci/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/test.sh b/.ci/test.sh index 516581ff0..579372a62 100755 --- a/.ci/test.sh +++ b/.ci/test.sh @@ -2,7 +2,7 @@ set -e -python -m pytest -v -x -W always --cov PIL --cov Tests --cov-report term Tests +python -bb -m pytest -v -x -W always --cov PIL --cov Tests --cov-report term Tests # Docs if [ "$TRAVIS_PYTHON_VERSION" == "3.8" ] && [ "$TRAVIS_CPU_ARCH" == "amd64" ]; then From 4e4fe2c17248795905a8dc676293cd15c23b323c Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Mon, 20 Jul 2020 14:56:18 +0100 Subject: [PATCH 2/2] Fix TiffImagePlugin interpolating bytes into str. --- src/PIL/TiffImagePlugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/PIL/TiffImagePlugin.py b/src/PIL/TiffImagePlugin.py index b56072737..cb4addd18 100644 --- a/src/PIL/TiffImagePlugin.py +++ b/src/PIL/TiffImagePlugin.py @@ -799,7 +799,7 @@ class ImageFileDirectory_v2(MutableMapping): if tag == STRIPOFFSETS: stripoffsets = len(entries) typ = self.tagtype.get(tag) - logger.debug("Tag {}, Type: {}, Value: {}".format(tag, typ, value)) + logger.debug("Tag {}, Type: {}, Value: {!r}".format(tag, typ, value)) values = value if isinstance(value, tuple) else (value,) data = self._write_dispatch[typ](self, *values)