mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-05-04 10:59:08 +02:00
lint: Make sure we read the command line inputs using utf-8 decoding in python
This commit is contained in:
@@ -26,8 +26,8 @@ SET_DOC_OPTIONAL = set(['-rpcssl', '-benchmark', '-h', '-help', '-socks', '-tor'
|
||||
|
||||
|
||||
def main():
|
||||
used = check_output(CMD_GREP_ARGS, shell=True, universal_newlines=True)
|
||||
docd = check_output(CMD_GREP_DOCS, shell=True, universal_newlines=True)
|
||||
used = check_output(CMD_GREP_ARGS, shell=True, universal_newlines=True, encoding='utf8')
|
||||
docd = check_output(CMD_GREP_DOCS, shell=True, universal_newlines=True, encoding='utf8')
|
||||
|
||||
args_used = set(re.findall(re.compile(REGEX_ARG), used))
|
||||
args_docd = set(re.findall(re.compile(REGEX_DOC), docd)).union(SET_DOC_OPTIONAL)
|
||||
|
||||
@@ -17,4 +17,12 @@ if [[ ${OUTPUT} != "" ]]; then
|
||||
echo "${OUTPUT}"
|
||||
EXIT_CODE=1
|
||||
fi
|
||||
OUTPUT=$(git grep "check_output(" -- "*.py" | 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}
|
||||
|
||||
Reference in New Issue
Block a user