Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poetry raises a [TypeError]'encoding' is an invalid keyword argument for this function when running in Python2.7 virtual environment #1290

Closed
3 tasks done
badrobit opened this issue Aug 9, 2019 · 12 comments
Labels
kind/bug Something isn't working as expected

Comments

@badrobit
Copy link

badrobit commented Aug 9, 2019

  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: Ubuntu 18.04

  • Poetry version: 0.12.17

  • Link of a Gist with the contents of your pyproject.toml file: I am not allowed due to company rules

Issue

When running poetry (command: poetry update) from within a 2.7 virtual environment while parsing a package defined as a git repository the following error occurs:

[TypeError]                                     
'encoding' is an invalid keyword argument for this function  

when run with the -vvv option I get the following:

Exception trace:
 /home/mroscoe/.poetry/lib/poetry/_vendor/py2.7/cleo/application.py in run() at line 94
   status_code = self.do_run(input_, output_)
 /home/mroscoe/.poetry/lib/poetry/console/application.py in do_run() at line 88
   return super(Application, self).do_run(i, o)
 /home/mroscoe/.poetry/lib/poetry/_vendor/py2.7/cleo/application.py in do_run() at line 197
   status_code = command.run(input_, output_)
 /home/mroscoe/.poetry/lib/poetry/console/commands/command.py in run() at line 77
   return super(BaseCommand, self).run(i, o)
 /home/mroscoe/.poetry/lib/poetry/_vendor/py2.7/cleo/commands/base_command.py in run() at line 146
   status_code = self.execute(input_, output_)
 /home/mroscoe/.poetry/lib/poetry/_vendor/py2.7/cleo/commands/command.py in execute() at line 107
   return self.handle()
 /home/mroscoe/.poetry/lib/poetry/console/commands/update.py in handle() at line 41
   return installer.run()
 /home/mroscoe/.poetry/lib/poetry/installation/installer.py in run() at line 73
   self._do_install(local_repo)
 /home/mroscoe/.poetry/lib/poetry/installation/installer.py in _do_install() at line 290
   self._execute(op)
 /home/mroscoe/.poetry/lib/poetry/installation/installer.py in _execute() at line 306
   getattr(self, "_execute_{}".format(method))(operation)
 /home/mroscoe/.poetry/lib/poetry/installation/installer.py in _execute_install() at line 331
   self._installer.install(operation.package)
 /home/mroscoe/.poetry/lib/poetry/installation/pip_installer.py in install() at line 35
   self.install_git(package)
 /home/mroscoe/.poetry/lib/poetry/installation/pip_installer.py in install_git() at line 230
   self.install_directory(pkg)
 /home/mroscoe/.poetry/lib/poetry/installation/pip_installer.py in install_directory() at line 196
   with open(setup, "w", encoding="utf-8") as f:

I was able to resolve the issue by adding the following import to the pip_installer.py file:

from io import open
@brycedrennan brycedrennan added the kind/bug Something isn't working as expected label Aug 16, 2019
@gramosg
Copy link

gramosg commented Sep 11, 2019

I have the same issue, does not happen in Poetry 0.12.16. Using it until this issue is solved.

@stale
Copy link

stale bot commented Nov 13, 2019

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the wontfix label Nov 13, 2019
@badrobit
Copy link
Author

Yes it is still relevant and needs to be fixed

@sdispater sdispater added stale and removed wontfix labels Nov 14, 2019
@stale stale bot removed the stale label Nov 14, 2019
@RoelantStegmann
Copy link

RoelantStegmann commented Apr 8, 2020

Also have this with 1.0.2

@jerpint
Copy link

jerpint commented Apr 23, 2020

Same Poetry version 1.0.2 on Ubuntu 18.04, using poetry inside a conda environment

@finswimmer
Copy link
Member

Hello @jerpint ,

can you please retry with the current release of poetry (1.0.5)? If the issue still exists, can you please describe step by step how one can reproduce it?

Thanks!

fin swimmer

@RoelantStegmann
Copy link

RoelantStegmann commented May 18, 2020

Still doesn't work for me.

conda create --name poetry python=3.7
activate poetry
conda install poetry
pip install poetry --upgrade
poetry install 

@jerpint
Copy link

jerpint commented May 18, 2020

Here's what ended up working for me:

poetry env use python3.7

Before doing poetry install

@v5y8
Copy link

v5y8 commented May 26, 2020

I also ran into this issue, on Poetry version 1.0.5 on Ubuntu 18.04 and running poetry inside a conda environment.

Apparently this can be caused by an outdated msgback-python package documented here and here.

I was able to solve this by running pip install --upgrade --user msgpack-python.

@mirosval
Copy link

I actually had to downgrade: pip install msgpack==0.6.2 pyenv & macOS

@finswimmer
Copy link
Member

Closing this because no more comments have been added for a long time and according to @v5y8 this seems not be a poetry issue.

Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

9 participants