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

Ascii decode error on install #82

Closed
oleiade opened this issue Sep 18, 2014 · 10 comments
Closed

Ascii decode error on install #82

oleiade opened this issue Sep 18, 2014 · 10 comments
Labels

Comments

@oleiade
Copy link

oleiade commented Sep 18, 2014

Hi!

I'm trying to pip install the library on ubuntu 14.04, in a virtualenv set up to use python3.3. And I end up with an ascii decode error thrown by the setup.py.

Here's the command I'm using to install:

pip install --allow-all-external --no-input --exists-action=w -r requirements.txt

Here's the output:

 Downloading/unpacking django-leaflet (from -r requirements.txt (line 33))
             Running setup.py (path:/home/blablabla/env/build/django-leaflet/setup.py) egg_info for package django-leaflet
               Traceback (most recent call last):
                 File "<string>", line 17, in <module>
                 File "/home/blablabla/env/build/django-leaflet/setup.py", line 19, in <module>
                   long_description=open(os.path.join(here, 'README.rst')).read() + '\n\n' +
                 File "/home/blablabla/env/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 0xc2 in position 5022: ordinal not in range(128)
               Complete output from command python setup.py egg_info:
               Traceback (most recent call last):

             File "<string>", line 17, in <module>

             File "/home/blablabla/env/build/django-leaflet/setup.py", line 19, in <module>

               long_description=open(os.path.join(here, 'README.rst')).read() + '\n\n' +

             File "/home/blablablabla/env/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 0xc2 in position 5022: ordinal not in range(128)

           ----------------------------------------
           Cleaning up...

I'm not sure about the proper solution. Maybe casting the long_description variable input to unicode explicitly when we're using python3?

Let me know,
Thanks!

@leplatrem
Copy link
Collaborator

Thanks for this feedback !

Indeed, there should be something about special characters in the README file.
As you said, I guess that casting to unicode should make it !
Can you try please ?

@tkloc
Copy link

tkloc commented Oct 29, 2014

Hi, i've encountered same problem with python 3.4 on debian wheezy. I had to install the locales-all package to fix this.

@leplatrem leplatrem added the bug label Nov 6, 2014
@leplatrem
Copy link
Collaborator

Based on your error :

>>> open('README.rst').read()[5022]
'©'

I will remove this special character :)

@leplatrem
Copy link
Collaborator

Can you check now ? If the bug was fixed, I'll release a new version. Thanks !

@valdemarrolfsen
Copy link

Still getting this error:

pip3.4 install --user django-leaflet

Collecting django-leaflet
Downloading django-leaflet-0.16.0.zip (231kB)
100% |################################| 233kB 1.6MB/s
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 20, in
File "/tmp/pip-build-w3of_1sh/django-leaflet/setup.py", line 19, in
long_description=open(os.path.join(here, 'README.rst')).read() + '\n\n' +
File "/usr/local/lib/python3.4/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 14276: ordinal not in range(128)

I am running the newest version of pip

@olivierdalang
Copy link

Hi,
I have the same error here (on one of my ubuntu setups, not both, but they are both relatively vanilla ubuntu 14.04, so I don't know what's going on...)
Bests,
Olivier

@olivierdalang
Copy link

By removing the content of README.rst and CHANGES, the installation works, so it must be an easy bug to fix.

If you can't wait : pip3 install -e git+https://github.com/olivierdalang/django-leaflet.git#egg=django-leaflet

@leplatrem
Copy link
Collaborator

Yes, we might have to read those files using utf8 codec, as it is done here:
https://github.com/mozilla-services/cliquet/blob/master/setup.py

Would like to try it and open a pull request please?
Le 22 sept. 2015 18:30, "olivierdalang" notifications@github.com a écrit :

By removing the content of README.rst and CHANGES, the installation works,
so it must be an easy bug to fix.

If you can't wait : pip3 install -e git+
https://github.com/olivierdalang/django-leaflet.git#egg=django-leaflet


Reply to this email directly or view it on GitHub
#82 (comment)
.

@KostyaEsmukov
Copy link
Contributor

Workaround (ubuntu trusty minimal):
$ LC_ALL=C.UTF-8 pip3 install django-leaflet

@cleder
Copy link
Contributor

cleder commented Sep 8, 2016

setenv LANG en_GB.UTF-8 solves this on freebsd with csh

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

No branches or pull requests

7 participants