Re: Strange encoding problem in setup.py of biopython 1.71

2018-04-13 Thread Peter Cock
I ended up doing something similar to catch any future
problematic characters:

https://github.com/biopython/biopython/pull/1607

Peter


On Fri, Apr 6, 2018 at 10:36 AM, Peter Cock  wrote:
> Thanks Andreas,
>
> Piotr, I think your fix would be worth including in Biopython.
>
> Do you want to submit this as a pull request, or give me
> permission to do so by email?
>
> We'd need you to agree to both the Biopython License Agreement
> and the 3-clause BSD licence, and say if you'd like to be
> acknowledged by name or not.
>
> Regards,
>
> Peter
>
> On Fri, Apr 6, 2018 at 8:16 AM, Andreas Tille  wrote:
>> Hi Peter,
>>
>> On Thu, Apr 05, 2018 at 04:19:50PM +0100, Peter Cock wrote:
>>>
>>> https://github.com/biopython/biopython/commit/6421d365a511c0de71748737ba6e1cd8518658ac
>>>
>>> Can you pull in that commit as a patch for the Biopython 1.71 package?
>>
>> Thanks.  I'm using this as patch.  I can confirm that this works now
>> (I'm using the other patch suggested here[1] in addition to deal with
>> potential other encoding issues.
>>
>> I'll upload soon (I had some other issues with the packaging which are
>> not related).
>>
>> Kind regards
>>
>> Andreas.
>>
>>
>> [1] https://lists.debian.org/debian-python/2018/04/msg00023.html
>>
>> --
>> http://fam-tille.de



Re: Strange encoding problem in setup.py of biopython 1.71

2018-04-06 Thread Andreas Tille
Hi Peter,

On Thu, Apr 05, 2018 at 04:19:50PM +0100, Peter Cock wrote:
> 
> https://github.com/biopython/biopython/commit/6421d365a511c0de71748737ba6e1cd8518658ac
> 
> Can you pull in that commit as a patch for the Biopython 1.71 package?

Thanks.  I'm using this as patch.  I can confirm that this works now
(I'm using the other patch suggested here[1] in addition to deal with
potential other encoding issues.
 
I'll upload soon (I had some other issues with the packaging which are
not related).

Kind regards

Andreas.


[1] https://lists.debian.org/debian-python/2018/04/msg00023.html

-- 
http://fam-tille.de



Re: Strange encoding problem in setup.py of biopython 1.71

2018-04-05 Thread Peter Cock
Confirmed - not sure if my earlier email made it?

https://github.com/biopython/biopython/commit/6421d365a511c0de71748737ba6e1cd8518658ac

Can you pull in that commit as a patch for the Biopython 1.71 package?

Peter

On Thu, Apr 5, 2018 at 3:39 PM, Klaus Zimmermann
 wrote:
> Hi Andreas,
>
> here, the culprit is
> U+2019 : RIGHT SINGLE QUOTATION MARK {single comma quotation mark}
> that is used as an apostrophe in two places in "Apple's".
>
> I found this by looking for 0xe2 (from your error message) in an hexdump
> (od -A d -xc README.rst |less ) at the named position (7116).
>
> Cheers
> Klaus
>
>
> On 05/04/18 16:34, Andreas Tille wrote:
>> Hi Olivier,
>>
>> On Thu, Apr 05, 2018 at 04:19:37PM +0200, Olivier Sallou wrote:
>>>
>>> On 04/05/2018 04:10 PM, Andreas Tille wrote:
 (maybe?) setup.py:


 ...
 dh_auto_clean
 pybuild --clean -i python{version} -p 2.7
 I: pybuild base:217: python2.7 setup.py clean
 running clean
 removing 
 '/home/andreas/debian-maintain/salsa/med-team/build-area/python-biopython-1.71+dfsg/.pybuild/cpython2_2.7/build'
  (and everything under it)
 'build/bdist.linux-x86_64' does not exist -- can't clean it
 'build/scripts-2.7' does not exist -- can't clean it
 pybuild --clean -i python{version} -p 3.6
 I: pybuild base:217: python3.6 setup.py clean
 Traceback (most recent call last):
   File "setup.py", line 435, in 
 readme_rst = handle.read()
   File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
 return codecs.ascii_decode(input, self.errors)[0]
 UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 7116: 
 ordinal not in range(128)
 E: pybuild pybuild:336: clean: plugin distutils failed with: exit code=1: 
 python3.6 setup.py clean
 dh_auto_clean: pybuild --clean -i python{version} -p 3.6 returned exit 
 code 13
>>> this is usually related to non ascii characters in file (readme.rst?) ,
>>> if you find some, you can patch file to remove them.
>>
>> Is there any efficient method to seek for this kind of non-ascii
>> characters?
>>
>> Kind regards
>>
>>   Andreas.
>>
>
>



Re: Strange encoding problem in setup.py of biopython 1.71

2018-04-05 Thread Klaus Zimmermann
Hi Andreas,

here, the culprit is
U+2019 : RIGHT SINGLE QUOTATION MARK {single comma quotation mark}
that is used as an apostrophe in two places in "Apple's".

I found this by looking for 0xe2 (from your error message) in an hexdump
(od -A d -xc README.rst |less ) at the named position (7116).

Cheers
Klaus


On 05/04/18 16:34, Andreas Tille wrote:
> Hi Olivier,
> 
> On Thu, Apr 05, 2018 at 04:19:37PM +0200, Olivier Sallou wrote:
>>
>> On 04/05/2018 04:10 PM, Andreas Tille wrote:
>>> (maybe?) setup.py:
>>>
>>>
>>> ...
>>> dh_auto_clean
>>> pybuild --clean -i python{version} -p 2.7
>>> I: pybuild base:217: python2.7 setup.py clean 
>>> running clean
>>> removing 
>>> '/home/andreas/debian-maintain/salsa/med-team/build-area/python-biopython-1.71+dfsg/.pybuild/cpython2_2.7/build'
>>>  (and everything under it)
>>> 'build/bdist.linux-x86_64' does not exist -- can't clean it
>>> 'build/scripts-2.7' does not exist -- can't clean it
>>> pybuild --clean -i python{version} -p 3.6
>>> I: pybuild base:217: python3.6 setup.py clean 
>>> Traceback (most recent call last):
>>>   File "setup.py", line 435, in 
>>> readme_rst = handle.read()
>>>   File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
>>> return codecs.ascii_decode(input, self.errors)[0]
>>> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 7116: 
>>> ordinal not in range(128)
>>> E: pybuild pybuild:336: clean: plugin distutils failed with: exit code=1: 
>>> python3.6 setup.py clean 
>>> dh_auto_clean: pybuild --clean -i python{version} -p 3.6 returned exit code 
>>> 13
>> this is usually related to non ascii characters in file (readme.rst?) ,
>> if you find some, you can patch file to remove them.
> 
> Is there any efficient method to seek for this kind of non-ascii
> characters?
> 
> Kind regards
> 
>   Andreas.
> 



Re: Strange encoding problem in setup.py of biopython 1.71

2018-04-05 Thread Piotr O┼╝arowski
[Andreas Tille, 2018-04-05]
> Traceback (most recent call last):
>   File "setup.py", line 435, in 
> readme_rst = handle.read()
>   File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
> return codecs.ascii_decode(input, self.errors)[0]
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 7116: 
> ordinal not in range(128)
> E: pybuild pybuild:336: clean: plugin distutils failed with: exit code=1: 
> python3.6 setup.py clean 
> dh_auto_clean: pybuild --clean -i python{version} -p 3.6 returned exit code 13
> ...

in setup.py, if you decide to keep supporting Python 2, change lines 434-435 
into:

  with open("README.rst", 'rb') as handle:
  readme_rst = handle.read().decode('UTF-8')

or if you finally let it go, change only line 434:

  with open("README.rst", encoding='UTF-8') as handle:
-- 
GPG: 1D2F A898 58DA AF62 1786 2DF7 AEF6 F1A2 A745 7645



Re: Strange encoding problem in setup.py of biopython 1.71

2018-04-05 Thread Andreas Tille
Hi Olivier,

On Thu, Apr 05, 2018 at 04:19:37PM +0200, Olivier Sallou wrote:
> 
> On 04/05/2018 04:10 PM, Andreas Tille wrote:
> > (maybe?) setup.py:
> >
> >
> > ...
> > dh_auto_clean
> > pybuild --clean -i python{version} -p 2.7
> > I: pybuild base:217: python2.7 setup.py clean 
> > running clean
> > removing 
> > '/home/andreas/debian-maintain/salsa/med-team/build-area/python-biopython-1.71+dfsg/.pybuild/cpython2_2.7/build'
> >  (and everything under it)
> > 'build/bdist.linux-x86_64' does not exist -- can't clean it
> > 'build/scripts-2.7' does not exist -- can't clean it
> > pybuild --clean -i python{version} -p 3.6
> > I: pybuild base:217: python3.6 setup.py clean 
> > Traceback (most recent call last):
> >   File "setup.py", line 435, in 
> > readme_rst = handle.read()
> >   File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
> > return codecs.ascii_decode(input, self.errors)[0]
> > UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 7116: 
> > ordinal not in range(128)
> > E: pybuild pybuild:336: clean: plugin distutils failed with: exit code=1: 
> > python3.6 setup.py clean 
> > dh_auto_clean: pybuild --clean -i python{version} -p 3.6 returned exit code 
> > 13
> this is usually related to non ascii characters in file (readme.rst?) ,
> if you find some, you can patch file to remove them.

Is there any efficient method to seek for this kind of non-ascii
characters?

Kind regards

  Andreas.

-- 
http://fam-tille.de



Strange encoding problem in setup.py of biopython 1.71

2018-04-05 Thread Andreas Tille
Hi,

I imported BioPython version 1.71 into the packaging Git[1] and tried to
build it.  Unfortunately I'm stumbling upon some encoding problem in
(maybe?) setup.py:


...
dh_auto_clean
pybuild --clean -i python{version} -p 2.7
I: pybuild base:217: python2.7 setup.py clean 
running clean
removing 
'/home/andreas/debian-maintain/salsa/med-team/build-area/python-biopython-1.71+dfsg/.pybuild/cpython2_2.7/build'
 (and everything under it)
'build/bdist.linux-x86_64' does not exist -- can't clean it
'build/scripts-2.7' does not exist -- can't clean it
pybuild --clean -i python{version} -p 3.6
I: pybuild base:217: python3.6 setup.py clean 
Traceback (most recent call last):
  File "setup.py", line 435, in 
readme_rst = handle.read()
  File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 7116: 
ordinal not in range(128)
E: pybuild pybuild:336: clean: plugin distutils failed with: exit code=1: 
python3.6 setup.py clean 
dh_auto_clean: pybuild --clean -i python{version} -p 3.6 returned exit code 13
...


I admit I have no idea how to fix this.  Any idea?

Kind regards

Andreas.


[1] https://salsa.debian.org/med-team/python-biopython

-- 
http://fam-tille.de