TypeError: 'encoding' is an invalid keyword argument for this function

Create issue
Issue #3 new
Nielson Santana created an issue

Getting error of parameter when I try install throught pip.

pip install -e hg+http://bitbucket.org/01100101/code128/@0.4b1#egg=code128 
Obtaining code128 from hg+http://bitbucket.org/01100101/code128/@0.4b1#egg=code128
  Updating /home/nsantana/.virtualenvs/gensoft/src/code128 clone (to revision 0.4b1)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/home/nsantana/.virtualenvs/gensoft/src/code128/setup.py", line 10, in <module>
        with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
    TypeError: 'encoding' is an invalid keyword argument for this function

Comments (5)

  1. Alistair Lynn

    @01100101 Would you mind please shipping the latest code onto PyPI, we're still having to install from HEAD.

  2. Francesco Rana

    SOLVED: you need to change your 'open' command using 'io' module instead. Here follows the changings in pseudo patch format:

    ++ import io from setuptools import setup, find_packages from os import path try: import py2exe except ImportError: pass

    here = path.abspath(path.dirname(file)) -- with open(path.join(here, 'README.rst'), encoding='utf-8') as f: ++ with io.open(path.join(here, 'README.rst'), encoding='utf-8') as f:

  3. Log in to comment