aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2022-09-21 14:13:55 +0545
committerMike Frysinger <vapier@gentoo.org>2022-09-21 14:13:55 +0545
commita94b2f664714a33eeeb492efe87525fa9947a644 (patch)
tree4a0936ac8e51a7854303cd6ecc13def63d39d964
parentlddtree: sort imports (diff)
downloadpax-utils-a94b2f664714a33eeeb492efe87525fa9947a644.tar.gz
pax-utils-a94b2f664714a33eeeb492efe87525fa9947a644.tar.bz2
pax-utils-a94b2f664714a33eeeb492efe87525fa9947a644.zip
lddtree: specify utf-8 encoding with text files
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rwxr-xr-xlddtree.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lddtree.py b/lddtree.py
index 1f66b4d..3c9d66f 100755
--- a/lddtree.py
+++ b/lddtree.py
@@ -184,7 +184,7 @@ exec \\
"""
wrappath = root + path
os.rename(wrappath, wrappath + '.elf')
- with open(wrappath, 'w') as f:
+ with open(wrappath, 'w', encoding='utf-8') as f:
f.write(wrapper % replacements)
os.chmod(wrappath, 0o0755)
@@ -251,7 +251,7 @@ def ParseLdSoConf(ldso_conf, root='/', debug=False, _first=True):
dbg_pfx = '' if _first else ' '
try:
dbg(debug, '%sParseLdSoConf(%s)' % (dbg_pfx, ldso_conf))
- with open(ldso_conf) as f:
+ with open(ldso_conf, encoding='utf-8') as f:
for line in f.readlines():
line = line.split('#', 1)[0].strip()
if not line: