summaryrefslogtreecommitdiff
path: root/tests/test_build.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_build.py')
-rw-r--r--tests/test_build.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/test_build.py b/tests/test_build.py
index 9dcf78165..62de3ea5f 100644
--- a/tests/test_build.py
+++ b/tests/test_build.py
@@ -4,7 +4,7 @@
Test all builders.
- :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
+ :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -36,7 +36,11 @@ def nonascii_srcdir(request, rootdir, sphinx_test_tempdir):
if not srcdir.exists():
(rootdir / 'test-root').copytree(srcdir)
except UnicodeEncodeError:
+ # Now Python 3.7+ follows PEP-540 and uses utf-8 encoding for filesystem by default.
+ # So this error handling will be no longer used (after dropping python 3.6 support).
srcdir = basedir / 'all'
+ if not srcdir.exists():
+ (rootdir / 'test-root').copytree(srcdir)
else:
# add a doc with a non-ASCII file name to the source dir
(srcdir / (test_name + '.txt')).write_text(dedent("""