-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Description
The script fails if the text to be replaced contains non-ascii or UTF-8 characters.
For example, the following symbol — will cause:
[ 35s] Traceback (most recent call last):
[ 35s] File "/usr/lib/obs/service/replace_using_package_version", line 186, in <module>
[ 35s] init(__name__)
[ 35s] File "/usr/lib/obs/service/replace_using_package_version", line 183, in init
[ 35s] main()
[ 35s] File "/usr/lib/obs/service/replace_using_package_version", line 99, in main
[ 35s] replacement
[ 35s] File "/usr/lib/obs/service/replace_using_package_version", line 105, in apply_regex_to_file
[ 35s] contents = in_file.read()
[ 35s] File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode
[ 35s] return codecs.ascii_decode(input, self.errors)[0]
[ 35s] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 3615: ordinal not in range(128)
[ 35s] service run failed for service 'replace_using_package_version'
— is not -, but it is commonly used to split a sentence.
’ is not ', but it can be a hard-to-spot typo and also causes the script to fail.
Metadata
Metadata
Assignees
Labels
No labels