$ docker build .
docker build .
Sending build context to Docker daemon 35.84 kB
Sending build context to Docker daemon
Step 0 : FROM python:3
---> cb8d462c9cc4
Step 1 : ADD . /code/
---> 12f5f950f84f
Removing intermediate container fb9bedc61d93
Step 2 : WORKDIR /code/
---> Running in 4b665cad845e
---> 0177a4167de2
Removing intermediate container 4b665cad845e
Step 3 : RUN python open_file.py
---> Running in 0443253b5b68
Traceback (most recent call last):
File "open_file.py", line 1, in <module>
open('file with unicode').read()
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 0xe2 in position 23: ordinal not in range(128)
2014/07/29 12:44:28 The command [/bin/sh -c python open_file.py] returned a non-zero code: 1
Last active
August 29, 2015 14:04
-
-
Save saulshanabrook/80da9c4a9d162bed2529 to your computer and use it in GitHub Desktop.
docker python unicode read bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3 | |
ADD . /code/ | |
WORKDIR /code/ | |
# ENV LANG C.UTF-8 if this is uncluded, no error | |
RUN python open_file.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
some unicode character ❣ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
open('file with unicode').read() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment