[opensuse-packaging] Python package fails to build with LC_ALL=C
![](https://seccdn.libravatar.org/avatar/ca9789ca82712456ebe792c2e7528baa.jpg?s=120&d=mm&r=g)
Hi! I am currently packaging python-aioresponses [1] which fails to build from source in OBS with the following backtrace: [ 37s] + echo python3 [ 37s] + /usr/bin/python3 setup.py build '--executable=/usr/bin/python3 -s' [ 37s] Traceback (most recent call last): [ 37s] File "setup.py", line 6, in <module> [ 37s] pbr=True, [ 37s] File "/usr/lib/python3.6/site-packages/setuptools/__init__.py", line 139, in setup [ 37s] _install_setup_requires(attrs) [ 37s] File "/usr/lib/python3.6/site-packages/setuptools/__init__.py", line 132, in _install_setup_requires [ 37s] dist.parse_config_files(ignore_option_errors=True) [ 37s] File "/usr/lib/python3.6/site-packages/setuptools/dist.py", line 492, in parse_config_files [ 37s] _Distribution.parse_config_files(self, filenames=filenames) [ 37s] File "/usr/lib64/python3.6/distutils/dist.py", line 395, in parse_config_files [ 37s] parser.read(filename) [ 37s] File "/usr/lib64/python3.6/configparser.py", line 697, in read [ 37s] self._read(fp, filename) [ 37s] File "/usr/lib64/python3.6/configparser.py", line 1015, in _read [ 37s] for lineno, line in enumerate(fp, start=1): [ 37s] File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode [ 37s] return codecs.ascii_decode(input, self.errors)[0] [ 37s] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 44: ordinal not in range(128) [ 37s] error: Bad exit status from /var/tmp/rpm-tmp.UucssU (%build) Turns out, this is an issue with the locale: glaubitz@suse-laptop:~/suse/home:glaubitz:branches:devel:languages:python/python-aioresponses/aioresponses-0.5.0> LC_ALL=C python3 setup.py build '--executable=/usr/bin/python3 -s' Traceback (most recent call last): File "setup.py", line 7, in <module> pbr=True, File "/usr/lib/python3.6/site-packages/setuptools/__init__.py", line 139, in setup _install_setup_requires(attrs) File "/usr/lib/python3.6/site-packages/setuptools/__init__.py", line 132, in _install_setup_requires dist.parse_config_files(ignore_option_errors=True) File "/usr/lib/python3.6/site-packages/setuptools/dist.py", line 492, in parse_config_files _Distribution.parse_config_files(self, filenames=filenames) File "/usr/lib64/python3.6/distutils/dist.py", line 395, in parse_config_files parser.read(filename) File "/usr/lib64/python3.6/configparser.py", line 697, in read self._read(fp, filename) File "/usr/lib64/python3.6/configparser.py", line 1015, in _read for lineno, line in enumerate(fp, start=1): File "/usr/lib64/python3.6/encodings/ascii.py", line 26, in decode return codecs.ascii_decode(input, self.errors)[0] UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 44: ordinal not in range(128) glaubitz@suse-laptop:~/suse/home:glaubitz:branches:devel:languages:python/python-aioresponses/aioresponses-0.5.0> python3 setup.py build '--executable=/usr/bin/python3 -s' running build running build_py running egg_info writing aioresponses.egg-info/PKG-INFO writing dependency_links to aioresponses.egg-info/dependency_links.txt writing requirements to aioresponses.egg-info/requires.txt writing top-level names to aioresponses.egg-info/top_level.txt [pbr] Reusing existing SOURCES.txt glaubitz@suse-laptop:~/suse/home:glaubitz:branches:devel:languages:python/python-aioresponses/aioresponses-0.5.0> I'm not sure though why the locale should have any impact on setuptools. Anyone got an idea? I've been debugging this for an hour now :-). Adrian
![](https://seccdn.libravatar.org/avatar/6f9e8d753f489c664f16d79682cb8215.jpg?s=120&d=mm&r=g)
On Monday, November 19, 2018 2:30:39 PM CET John Paul Adrian Glaubitz wrote:
I'm not sure though why the locale should have any impact on setuptools.
Anyone got an idea? I've been debugging this for an hour now :-).
In this case is because the author name in setup.cfg: author = Paweł Nuckowski -- SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/ca9789ca82712456ebe792c2e7528baa.jpg?s=120&d=mm&r=g)
On 11/19/18 2:36 PM, John Paul Adrian Glaubitz wrote:
Hmm, replacing that "ł" with just an "l" doesn't help, unfortunately. I still get: [ 5s] error in setup command: Error parsing /home/abuild/rpmbuild/BUILD/aioresponses-0.5.0/setup.cfg: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 192: ordinal not in range(128) [ 5s] error: Bad exit status from /var/tmp/rpm-tmp.XkKuGu (%build) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/ca9789ca82712456ebe792c2e7528baa.jpg?s=120&d=mm&r=g)
Hi! On 11/19/18 2:54 PM, Tomas Chvatal wrote:
I was thinking about that but wasn't sure whether just forcing UTF-8 would be allowed for spec files. Adrian -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/ca9789ca82712456ebe792c2e7528baa.jpg?s=120&d=mm&r=g)
On 11/19/18 3:03 PM, Tomas Chvatal wrote:
See package python-pylama as one of the ones already using it.
Tried the following but it still fails: - python-aioresponses.spec (revision abfa4df2e69e841fc221e73795548a5d) +++ python-aioresponses.spec (working copy) @@ -53,12 +53,15 @@ Mock out requests made by ClientSession from aiohttp package %prep +export LANG=en_US.UTF-8 %setup -q -n aioresponses-%{version} %build +export LANG=en_US.UTF-8 %python_build %install +export LANG=en_US.UTF-8 %python_install %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/fff0f38e92656c8a636916213eb952c4.jpg?s=120&d=mm&r=g)
Hi, On Mon, 19 Nov 2018, John Paul Adrian Glaubitz wrote:
Probably LC_ALL is set to something? That takes precedence over $LANG if it's set. output of 'locale' in the build would show you, or just do an unset LC_ALL, or use LC_ALL instead of LANG. Ciao, Michael.
-- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/833649deea07c68de42500ad14c257f6.jpg?s=120&d=mm&r=g)
Are you sure you are testing the modified specfile? Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/833649deea07c68de42500ad14c257f6.jpg?s=120&d=mm&r=g)
You didn't change %check. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/ca9789ca82712456ebe792c2e7528baa.jpg?s=120&d=mm&r=g)
On 11/19/18 3:38 PM, Andreas Schwab wrote:
You didn't change %check.
Indeed, that was missing. But now the testsuite is failing because it tries to connect to an external website *sigh*. Adrian -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/8f947802c8278f7de589d948d49d1c97.jpg?s=120&d=mm&r=g)
On 2018-11-19 14:36:35 +0100, John Paul Adrian Glaubitz wrote:
That file is probably utf-8 encoded (I haven't checked it), but LC_ALL=C forces an ascii decoding of the file. Just check python3 -c "open('setup.cfg', 'r', encoding='utf-8').read()" vs. python3 -c "open('setup.cfg', 'r', encoding='ascii').read()" and LC_ALL=en_US.UTF-8 python3 -c "open('setup.cfg', 'r').read()" vs. LC_ALL=C python3 -c "open('setup.cfg', 'r').read()" Marcus -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/ca9789ca82712456ebe792c2e7528baa.jpg?s=120&d=mm&r=g)
Hi! On 11/19/18 3:23 PM, Marcus Hüwe wrote:
Yes, as stated in my initial mail, setting LC_ALL=en_US.UTF-8 works. The question remains, how to use that in the spec file? Adrian -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/6f9e8d753f489c664f16d79682cb8215.jpg?s=120&d=mm&r=g)
On Monday, November 19, 2018 2:30:39 PM CET John Paul Adrian Glaubitz wrote:
I'm not sure though why the locale should have any impact on setuptools.
Anyone got an idea? I've been debugging this for an hour now :-).
In this case is because the author name in setup.cfg: author = Paweł Nuckowski -- SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton, HRB 21284 (AG Nürnberg) Maxfeldstraße 5, 90409 Nürnberg, Germany -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/ca9789ca82712456ebe792c2e7528baa.jpg?s=120&d=mm&r=g)
On 11/19/18 2:36 PM, John Paul Adrian Glaubitz wrote:
Hmm, replacing that "ł" with just an "l" doesn't help, unfortunately. I still get: [ 5s] error in setup command: Error parsing /home/abuild/rpmbuild/BUILD/aioresponses-0.5.0/setup.cfg: UnicodeDecodeError: 'ascii' codec can't decode byte 0xc5 in position 192: ordinal not in range(128) [ 5s] error: Bad exit status from /var/tmp/rpm-tmp.XkKuGu (%build) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
![](https://seccdn.libravatar.org/avatar/ca9789ca82712456ebe792c2e7528baa.jpg?s=120&d=mm&r=g)
Hi! On 11/19/18 2:54 PM, Tomas Chvatal wrote:
I was thinking about that but wasn't sure whether just forcing UTF-8 would be allowed for spec files. Adrian -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (6)
-
Andreas Schwab
-
aplanas@suse.de
-
John Paul Adrian Glaubitz
-
Marcus Hüwe
-
Michael Matz
-
Tomas Chvatal