Skip to content

Commit

Permalink
lddtree: specify utf-8 encoding with text files
Browse files Browse the repository at this point in the history
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
  • Loading branch information
vapier committed Sep 21, 2022
1 parent e165b0b commit a94b2f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lddtree.py
Expand Up @@ -184,7 +184,7 @@ def GenerateLdsoWrapper(root, path, interp, libpaths=()):
"""
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)

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit a94b2f6

Please sign in to comment.