* Piotr Ożarowski: " Re: Bug#725788: dh-python: python3.3 setup.py clean fails
  with UnicodeDecodeError" (Wed, 9 Oct 2013 22:58:15 +0200):

Hi Piotr,

> [Mathias Behrle, 2013-10-08]
>> E: pybuild pybuild:255: clean: plugin distutils failed with: exit
>> code=1: python3.3 setup.py clean
>> (complete build log and rules file attached)
>> 
>> I am able to build another package (vatnumber) with the same
>> configuration. I tried to remove non-ASCII 'é' from 'Cédric Krier' in
>> setup.py, but had no success.
> 
> it's not about pybuild opening setup.py, it's about...
> 
>> Traceback (most recent call last):
>>   File setup.py, line 44, in <module>
>>     version=get_version(),
>>   File setup.py, line 40, in get_version
>>     init = read(os.path.join('sql', '__init__.py'))
>>   File setup.py, line 36, in read
>>     return open(os.path.join(os.path.dirname(__file__), fname)).read()
>>   File /usr/lib/python3.3/encodings/ascii.py, line 26, in decode
>>     return codecs.ascii_decode(input, self.errors)[0]
>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 54:
>> ordinal not in range(128) E: pybuild pybuild:255: clean: plugin distutils
>> failed with: exit code=1: python3.3 setup.py clean 
> 
> setup.py file opening sql/__init__.py file.
> 
> try this:  - it will fail as well

When running from command line it doesn't fail

mathiasb@obelix:~/itp/python-sql$ python setup.py clean
running clean
mathiasb@obelix:~/itp/python-sql$ python3.3 setup.py clean
running clean

So I am little bit stuck here. Couldn't this have to do with the environment in
pybuild?

Removing those non-ASCII chars from __init__.py indeed solves the problem, but
I think with
# -*- coding: utf-8 -*-
those chars should be allowed and the file indeed is UTF-8:

mathiasb@obelix:~/itp/python-sql$ file sql/__init__.py
sql/__init__.py: Python script, UTF-8 Unicode text executable

-- 

    Mathias Behrle
    MBSolutions
    Gilgenmatten 10 A
    D-79114 Freiburg

    Tel: +49(761)471023
    Fax: +49(761)4770816
    http://m9s.biz
    UStIdNr: DE 142009020
    PGP/GnuPG key availabable from any keyserver, ID: 0x8405BBF6

Attachment: signature.asc
Description: PGP signature

Reply via email to