I bumped into the following bug. When not all files are utf-8 encodable, tests fail on poetry run pytest -v.
============================================================== ERRORS =============================================================== ____________________________________________ ERROR collecting tests/anonymized/test.txt _____________________________________________ .venv/lib/python3.8/site-packages/py/_path/common.py:171: in read_text return f.read() ../../../.pyenv/versions/3.8.2/lib/python3.8/codecs.py:322: in decode (result, consumed) = self._buffer_decode(data, self.errors, final) E UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf8 in position 380: invalid start byte ====================================================== short test summary info ====================================================== ERROR tests/anonymized/test.txt - UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf8 in position 380: invalid start byte !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
In the meantime, exactly the same setup worked with Python 3.7, and if I run tests with poetry run pytest tests/my_tests.py.
I am using: Python 3.8.2, poetry 1.0.5
How can I fix it? This bug is annoying as it fails in CI.