aboutsummaryrefslogtreecommitdiff
path: root/test/lint/lint-python-utf8-encoding.sh
diff options
context:
space:
mode:
authorDimitri <kvaciral@protonmail.com>2022-04-19 02:06:17 +0200
committerDimitri <kvaciral@protonmail.com>2022-04-21 23:26:45 +0200
commit035eef4be6071a060260907001363a0d12f1f2d2 (patch)
tree3e5c30389b25b402f389d461efc8cd15d39dae52 /test/lint/lint-python-utf8-encoding.sh
parent57a73d71a36ce212977607d3e94de6ef55521bfc (diff)
downloadbitcoin-035eef4be6071a060260907001363a0d12f1f2d2.tar.xz
lint: Convert lint-python-utf8-encoding.sh to Python
Diffstat (limited to 'test/lint/lint-python-utf8-encoding.sh')
-rwxr-xr-xtest/lint/lint-python-utf8-encoding.sh28
1 files changed, 0 insertions, 28 deletions
diff --git a/test/lint/lint-python-utf8-encoding.sh b/test/lint/lint-python-utf8-encoding.sh
deleted file mode 100755
index 6e5b18fc23..0000000000
--- a/test/lint/lint-python-utf8-encoding.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/env bash
-#
-# Copyright (c) 2018-2020 The Bitcoin Core developers
-# Distributed under the MIT software license, see the accompanying
-# file COPYING or http://www.opensource.org/licenses/mit-license.php.
-#
-# Make sure we explicitly open all text files using UTF-8 (or ASCII) encoding to
-# avoid potential issues on the BSDs where the locale is not always set.
-
-export LC_ALL=C
-EXIT_CODE=0
-OUTPUT=$(git grep " open(" -- "*.py" ":(exclude)src/crc32c/" | grep -vE "encoding=.(ascii|utf8|utf-8)." | grep -vE "open\([^,]*, ['\"][^'\"]*b[^'\"]*['\"]")
-if [[ ${OUTPUT} != "" ]]; then
- echo "Python's open(...) seems to be used to open text files without explicitly"
- echo "specifying encoding=\"utf8\":"
- echo
- echo "${OUTPUT}"
- EXIT_CODE=1
-fi
-OUTPUT=$(git grep "check_output(" -- "*.py" ":(exclude)src/crc32c/"| grep "universal_newlines=True" | grep -vE "encoding=.(ascii|utf8|utf-8).")
-if [[ ${OUTPUT} != "" ]]; then
- echo "Python's check_output(...) seems to be used to get program outputs without explicitly"
- echo "specifying encoding=\"utf8\":"
- echo
- echo "${OUTPUT}"
- EXIT_CODE=1
-fi
-exit ${EXIT_CODE}