Skip to content

Commit

Permalink
rpm: fix issues when running on old linux
Browse files Browse the repository at this point in the history
When running on CentOS7 I was getting some weird encoding issues,
mostly because it was falling back to ascii encoding by default:
```
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1045: ordinal not in range(128)
```

By passing utf-8 directly it seems to solve part of the issues
  • Loading branch information
manuelnaranjo committed Dec 19, 2023
1 parent 1583745 commit 2ef1db3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/make_rpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def CopyAndRewrite(input_file, output_file, replacements=None, template_replacem
"""

with open(output_file, 'w') as output:
for line in fileinput.input(input_file):
for line in fileinput.input(input_file, encoding='utf-8'):
if replacements:
for prefix, text in replacements.items():
if line.startswith(prefix):
Expand Down

0 comments on commit 2ef1db3

Please sign in to comment.