aboutsummaryrefslogtreecommitdiff
path: root/contrib/devtools
diff options
context:
space:
mode:
authorChun Kuan Lee <ken2812221@gmail.com>2018-09-02 06:40:56 +0800
committerChun Kuan Lee <ken2812221@gmail.com>2018-09-02 21:40:51 +0800
commit5d62dcf9cfb5c0b2511c10667ed47ec3b3610d72 (patch)
tree889a75810b9d906e72597ef8ed533db2aa0ed31a /contrib/devtools
parentbdbd654df8ddf5945256f2ccf85feae620f6f0d5 (diff)
lint: Make sure we read the command line inputs using utf-8 decoding in python
Diffstat (limited to 'contrib/devtools')
-rwxr-xr-xcontrib/devtools/optimize-pngs.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/devtools/optimize-pngs.py b/contrib/devtools/optimize-pngs.py
index 8b1f41f7e1..e9481dbbcf 100755
--- a/contrib/devtools/optimize-pngs.py
+++ b/contrib/devtools/optimize-pngs.py
@@ -27,7 +27,7 @@ def content_hash(filename):
pngcrush = 'pngcrush'
git = 'git'
folders = ["src/qt/res/movies", "src/qt/res/icons", "share/pixmaps"]
-basePath = subprocess.check_output([git, 'rev-parse', '--show-toplevel'], universal_newlines=True).rstrip('\n')
+basePath = subprocess.check_output([git, 'rev-parse', '--show-toplevel'], universal_newlines=True, encoding='utf8').rstrip('\n')
totalSaveBytes = 0
noHashChange = True
@@ -50,7 +50,7 @@ for folder in folders:
sys.exit(0)
#verify
- if "Not a PNG file" in subprocess.check_output([pngcrush, "-n", "-v", file_path], stderr=subprocess.STDOUT, universal_newlines=True):
+ if "Not a PNG file" in subprocess.check_output([pngcrush, "-n", "-v", file_path], stderr=subprocess.STDOUT, universal_newlines=True, encoding='utf8'):
print("PNG file "+file+" is corrupted after crushing, check out pngcursh version")
sys.exit(1)