Skip to content

Commit 6301147

Browse files
AA-Turnerbluetech
authored andcommitted
Enable Python 3.10's EncodingWarning
This warns on the default encoding being used in ``open`` or ``io.open``, which can lead to cross-platform bugs (for example on Windows where the default codepage is cp1252), or with the upcoming change to the default Python encoding (PEP 686, Make UTF-8 mode default https://peps.python.org/pep-0686/)
1 parent a15f544 commit 6301147

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tox.ini

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ passenv =
3838
setenv =
3939
_PYTEST_TOX_DEFAULT_POSARGS={env:_PYTEST_TOX_POSARGS_DOCTESTING:} {env:_PYTEST_TOX_POSARGS_LSOF:} {env:_PYTEST_TOX_POSARGS_XDIST:}
4040

41+
# Warn where default encoding is used
42+
# https://docs.python.org/3/library/io.html#io-encoding-warning
43+
PYTHONWARNDEFAULTENCODING=1
44+
4145
# Configuration to run with coverage similar to CI, e.g.
4246
# "tox -e py37-coverage".
4347
coverage: _PYTEST_TOX_COVERAGE_RUN=coverage run -m

0 commit comments

Comments
 (0)