diff options
author | Chandan Kumar (raukadah) <raukadah@gmail.com> | 2019-05-20 14:01:40 +0530 |
---|---|---|
committer | Jan Willhaus <mail@janwillhaus.de> | 2019-05-20 11:49:37 +0200 |
commit | a9cde4a9bff27544314f5a7ca13d22aaaac9d884 (patch) | |
tree | acb71abb5b1fe0d24953c1792fd3a8d0f060f7ed | |
parent | 3c3f849864d2d61c8b79e3313c947f63de7b04a4 (diff) | |
download | warlock-release1.3.2.tar.gz |
use io module for handling encoding while opening file in setup.pyrelease1.3.2
Currently in release 1.3.2 is failing while doing python setup.py
install with TypeError: 'encoding' is an invalid keyword argument
for this function while reading warlock/setup.py", line 28, in read
os.path.join(os.path.dirname(__file__), fname), "r", encoding="utf-8"
By using io module while reading the file fixes the issue.
Signed-off-by: Chandan Kumar (raukadah) <raukadah@gmail.com>
-rw-r--r-- | setup.py | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -13,18 +13,19 @@ # limitations under the License. import setuptools +import io import os def parse_requirements(): - fap = open("requirements.txt", "r", encoding="utf-8") + fap = io.open("requirements.txt", "r", encoding="utf-8") raw_req = fap.read() fap.close() return raw_req.split("\n") def read(fname): - with open( + with io.open( os.path.join(os.path.dirname(__file__), fname), "r", encoding="utf-8" ) as fp: return fp.read() |