[git-buildpackage] [PATCH] bin: drop umlaut again for setuptools

Ken Dreyer kdreyer at redhat.com
Tue May 15 00:11:26 CEST 2018


Hi Guido,

I looked into why why buildd is succeeding when a normal "python
setup.py install" fails. pybuild expands to the following:

  /usr/bin/python3 setup.py install --root /PKGBUILDDIR/debian/tmp

With the "--root" argument, setuptools takes a different code path,
simply copying the files without translating them to ascii
(copy_tree() method in setuptools/command/install_lib.py)

Without the "--root" argument, setuptools bails with
UnicodeDecodeError in (write_script() method in
setuptools/command/easy_install.py).

Looks like Travis CI might not be exercising the setuptools code.

Unfortunately this seems like a longstanding issue with setuptools,
https://github.com/pypa/setuptools/issues/761

- Ken

On Mon, May 14, 2018 at 2:52 PM, Guido Günther <agx at sigxcpu.org> wrote:
> On Mon, May 14, 2018 at 10:43:39AM -0600, Ken Dreyer wrote:
>> setuptools cannot handle non-ascii characters in files declared in
>> "scripts".
>
> It does here, on Debian's buildds and travis-ci. Is this a locale thing.
> Does
>
>     LC_ALL=C.UTF-8 python setup.py develop
>
> make any difference? Sorry for nitpicking here but it would be so nice
> if 2018 would be the year of utf-8.
>  -- Guido
>
>>
>> $ python setup.py develop
>>
>>   [snip]
>>
>>   File "setuptools/command/easy_install.py", line 726, in process_distribution
>>     self.install_egg_scripts(dist)
>>   File "setuptools/command/develop.py", line 188, in install_egg_scripts
>>     self.install_script(dist, script_name, script_text, script_path)
>>   File "setuptools/command/easy_install.py", line 805, in install_script
>>     self.write_script(script_name, _to_ascii(script_text), 'b')
>>   File "setuptools/command/easy_install.py", line 108, in _to_ascii
>>     return s.encode('ascii')
>> UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 785: ordinal not in range(128)
>>
>> Commit 4424008f6aaa7ce93d02f0c4948ad50542284ece fixed this, and
>> 23874c2c50ebd57426797d38f4f9c6c40dc336ec added the umlaut back in. Take
>> it out again so "setup.py develop" and "setup.py install" succeeds
>> again.
>> ---
>>  bin/gbp-builder-mock | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/bin/gbp-builder-mock b/bin/gbp-builder-mock
>> index 3a251a6f..a498823c 100755
>> --- a/bin/gbp-builder-mock
>> +++ b/bin/gbp-builder-mock
>> @@ -17,7 +17,7 @@
>>  #  <http://www.gnu.org/licenses/>
>>  #
>>  #  Copyright (C) 2015 Tzafrir Cohen
>> -#            (C) 2015 Guido Günther
>> +#            (C) 2015 Guido Gunther
>>
>>  set -e
>>
>> --
>> 2.14.3
>>
>> _______________________________________________
>> git-buildpackage mailing list
>> git-buildpackage at lists.sigxcpu.org
>> http://lists.sigxcpu.org/mailman/listinfo/git-buildpackage


More information about the git-buildpackage mailing list