Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed build with python3.6 #229

Closed
wenheping opened this issue Dec 3, 2018 · 5 comments
Closed

Failed build with python3.6 #229

wenheping opened this issue Dec 3, 2018 · 5 comments

Comments

@wenheping
Copy link

Hi,

I failed build num2words-0.5.8 with python-3.6 on FreeBSD-11.2, while 2.7 and 3.7 success.
The error message is :
=======================<phase: configure >============================
===> py36-num2words-0.5.8 depends on package: py36-setuptools>0 - found
===> py36-num2words-0.5.8 depends on file: /usr/local/bin/python3.6 - found
===> py36-num2words-0.5.8 depends on file: /usr/local/bin/ccache - found
===> Configuring for py36-num2words-0.5.8
Traceback (most recent call last):
File "", line 1, in
File "setup.py", line 20, in
LONG_DESC = open('README.rst', 'rt').read() + '\n\n' +
File "/usr/local/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 0xc3 in position 1557: ordinal not in range(128)
*** Error code 1

Any suggestions ?

wen

@erozqba
Copy link
Collaborator

erozqba commented Dec 3, 2018

Hello @wenheping, that it's weird because we run all tests on different versions, check here https://travis-ci.org/savoirfairelinux/num2words/builds/456499402 also the 'README.rst' it's the same for all versions of python so it's hard to identify which character it's causing problems on python 3.6.
Could you make some more investigation and try to point out the source of the problem?
Thanks a lot in advance.

@null-git
Copy link

null-git commented Dec 5, 2018

Hi, I'm the maintainer of the FreeBSD port.

The break occured in the 0.5.8 release, 0.5.7 builds fine on python 3.6.
The character in question seems to be the 'é' in line 50 in README.rst, so it seems to be some kind of encoding error. But why it only happens on python 3.6 and only in this version of the library I can't say.

Anyway, opening all files in setup.py with encoding='utf-8' set fixes the problem.

Edit: Hm, this doesn't work for python 2.7 though, maybe you have a better idea? I'm not too experienced with all this utf-8 stuff..

@erozqba
Copy link
Collaborator

erozqba commented Dec 5, 2018

@null-git I will also suggest removing the problematic example on the README.rst file

diff --git a/README.rst b/README.rst
index d9f4cd2..8e509c1 100644
--- a/README.rst
+++ b/README.rst
@@ -46,8 +46,6 @@ Command line::
 
     $ num2words 10001
     ten thousand and one
-    $ num2words 10123123 --lang es
-    diez millones ciento veintitrés mil ciento veintitrés
     $ num2words 24,120.10
     twenty-four thousand, one hundred and twenty point one
     $ num2words 24,120.10 -l es

I have created a PR #231 to try to fix this problem. Can you test this branch and provide some feedback?

@null-git
Copy link

null-git commented Jan 7, 2019

Could we have a new release to include this fix?

@erozqba
Copy link
Collaborator

erozqba commented Jan 7, 2019

@null-git sure, I will prepare one as soon as possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants