diff --git a/appveyor.yml b/appveyor.yml index 3e0db3a041e..a5117b047d4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -173,7 +173,7 @@ test_script: git diff -U0 FETCH_HEAD...HEAD > $prDiff $flake8Config = "$lintSource\flake8.ini" $flake8Output = "$lintOutput\PR-Flake8.txt" - type "$prDiff" | py -m flake8 --diff --output-file="$flake8Output" --tee --config="$flake8Config" + type "$prDiff" | py -Xutf8 -m flake8 --diff --output-file="$flake8Output" --tee --config="$flake8Config" if($LastExitCode -ne 0) { $errorCode=$LastExitCode Add-AppveyorMessage "PR introduces Flake8 errors" diff --git a/tests/lint/sconscript b/tests/lint/sconscript index a7d9a6b0a86..ccd52a1b381 100644 --- a/tests/lint/sconscript +++ b/tests/lint/sconscript @@ -47,7 +47,9 @@ lintTarget = externalEnv.Command( "current.diff", [[ 'type', '$SOURCE', '|', # provide diff to stdin - sys.executable, "-m", "flake8", + sys.executable, + "-Xutf8", # UTF-8 mode (PEP 540, Python >= 3.7) + "-m", "flake8", '--diff', # accept a unified diff from stdin '--output-file=$TARGET', # output to a file to allow easier inspection '--tee', # also output to stdout, so results appear in scons output