garnaat / kappa

What precedes Lambda
http://kappa.readthedocs.org/en/develop/
Apache License 2.0
902 stars 89 forks source link

Make setup.py parseable on Python 3 with LANG=C (or unset). #122

Closed dacut closed 1 year ago

dacut commented 7 years ago

Running pip install kappa in a barebones environment (e.g. AmazonLinux Docker container), or anything where LANG is not UTF-8 (e.g. en_US.UTF-8) fails without this patch. This is because setup.py runs open_file("README.rst"), which in turn opens the file in text mode. On Python 3, this uses the ASCII codec, but README.rst contains UTF-8 characters.

This patch forcibly parses README.rst (and requirements.txt) as UTF-8 regardless of the user's codec.

wobeng commented 7 years ago

dacut, im having the same issue.

Do you know how to set LANG on AmazonLinux Docker container?

dacut commented 7 years ago

Build a new container; in the Dockerfile for it, include this before installing kappa (or whatever depends on kappa):

FROM amazonlinux:latest
ENV LANG=en_US.UTF-8

Or you can prefix your pip install:

LANG=en_US.UTF-8 pip install kappa
wobeng commented 7 years ago

Thanks :)