From 26b478f958bfa82c14700b9c26b70af2592702b9 Mon Sep 17 00:00:00 2001 From: Julien Sabatier Date: Thu, 15 Oct 2015 15:15:48 +0200 Subject: [PATCH] Correct setup.py On Debian Jessie with pip install : Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 20, in File "/tmp/pip-o_ERWm-build/setup.py", line 16, in with open('requirements.txt', encoding='utf-8') as reqs: TypeError: 'encoding' is an invalid keyword argument for this function --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0eff0785..0ac44a2f 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- import codecs +import io from setuptools import setup, find_packages @@ -13,7 +14,7 @@ long_description = codecs.open('README.md', "r", "utf-8").read() def is_pkg(line): return line and not line.startswith(('--', 'git', '#')) -with open('requirements.txt', encoding='utf-8') as reqs: +with io.open('requirements.txt', encoding='utf-8') as reqs: install_requires = [l for l in reqs.read().split('\n') if is_pkg(l)] setup(