Am Dienstag, 19. November 2019, 17:15:31 CET schrieb Axel Braun:
Hi,
when compiling a python program on OBS I run into the above error:
[ 115s] + python3 setup.py build [ 115s] Traceback (most recent call last): [ 115s] File "setup.py", line 55, in <module> [ 115s] long_description=read('README'), [ 115s] File "setup.py", line 25, in read [ 115s] return open(os.path.join(os.path.dirname(__file__), fname)).read() [ 115s] File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode [ 115s] return codecs.ascii_decode(input, self.errors)[0] [ 115s] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 3095: ordinal not in range(128) [ 115s] error: Bad exit status from /var/tmp/rpm-tmp.FNH2vz (%build)
Now, the funny thing is, *exactly* the same README file was decoded properly in a different module (and in the same build-run).
Issue solved, problem was in the setup.py, where the encoding was not explicitly stated. Corrected version def read(fname): return open(os.path.join(os.path.dirname(__file__), fname), encoding="UTF-8").read() (should it not be UTF-8 by default?) Cheers Axel -- To unsubscribe, e-mail: opensuse-support+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-support+owner@opensuse.org