BertrandBordage / django-super-inlines

Adds useful features to inlines, such as the ability to nest them.
BSD 3-Clause "New" or "Revised" License
75 stars 8 forks source link

UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 385: ordinal not in range(128) #12

Open Matvey-Kuk opened 9 years ago

Matvey-Kuk commented 9 years ago
 Downloading django-super-inlines-0.1.4.tar.gz
  Running setup.py (path:/tmp/pip_build_root/django-super-inlines/setup.py) egg_info for package django-super-inlines
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip_build_root/django-super-inlines/setup.py", line 22, in <module>
        long_description=open('README.rst').read(),
      File "/usr/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 0xe2 in position 385: 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 "/tmp/pip_build_root/django-super-inlines/setup.py", line 22, in <module>

    long_description=open('README.rst').read(),

  File "/usr/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 0xe2 in position 385: ordinal not in range(128)

Hello!

I see this issue when install package in Docker container. After some investigation I establised that issue appears when system locale looks like:

Step 3 : RUN locale
 ---> Running in cc6ed90a368e
LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

, after setting custom locale everything is ok:

RUN sudo locale-gen "en_US.UTF-8"
ENV LC_CTYPE "en_US.UTF-8"
ENV LC_NUMERIC "en_US.UTF-8"
ENV LC_TIME "en_US.UTF-8"
ENV LC_COLLATE "en_US.UTF-8"
ENV LC_MONETARY "en_US.UTF-8"
ENV LC_MESSAGES "en_US.UTF-8"
ENV LC_PAPER "en_US.UTF-8"
ENV LC_NAME "en_US.UTF-8"
ENV LC_ADDRESS "en_US.UTF-8"
ENV LC_TELEPHONE "en_US.UTF-8"
ENV LC_MEASUREMENT "en_US.UTF-8"
ENV LC_IDENTIFICATION "en_US.UTF-8"

This issue is critical for using this library in docker-based production environment.

mkmushegh commented 7 years ago

same problem, but did not resolve the problem yet, any other idea?