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

'PosixPath' object has no attribute 'endswith' #2600

Closed
3 tasks done
akarsh1995 opened this issue Jun 28, 2020 · 5 comments · Fixed by #2582
Closed
3 tasks done

'PosixPath' object has no attribute 'endswith' #2600

akarsh1995 opened this issue Jun 28, 2020 · 5 comments · Fixed by #2582
Labels
kind/bug Something isn't working as expected

Comments

@akarsh1995
Copy link

akarsh1995 commented Jun 28, 2020

  • 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).

Issue


[AttributeError]
'PosixPath' object has no attribute 'endswith'

Traceback (most recent call last):
  File "/Users/akarshjain/.poetry/lib/poetry/_vendor/py2.7/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/Users/akarshjain/.poetry/lib/poetry/_vendor/py2.7/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/Users/akarshjain/.poetry/lib/poetry/_vendor/py2.7/clikit/api/command/command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "/Users/akarshjain/.poetry/lib/poetry/_vendor/py2.7/cleo/commands/command.py", line 92, in wrap_handle
    return self.handle()
  File "/Users/akarshjain/.poetry/lib/poetry/console/commands/install.py", line 69, in handle
    return_code = installer.run()
  File "/Users/akarshjain/.poetry/lib/poetry/installation/installer.py", line 74, in run
    self._do_install(local_repo)
  File "/Users/akarshjain/.poetry/lib/poetry/installation/installer.py", line 286, in _do_install
    self._execute(op)
  File "/Users/akarshjain/.poetry/lib/poetry/installation/installer.py", line 302, in _execute
    getattr(self, '_execute_{}'.format(method))(operation)
  File "/Users/akarshjain/.poetry/lib/poetry/installation/installer.py", line 327, in _execute_install
    self._installer.install(operation.package)
  File "/Users/akarshjain/.poetry/lib/poetry/installation/pip_installer.py", line 90, in install
    req = self.requirement(package)
  File "/Users/akarshjain/.poetry/lib/poetry/installation/pip_installer.py", line 146, in requirement
    req = os.path.join(package.root_dir, package.source_url)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 70, in join
    elif path == '' or path.endswith('/'):

Adding source distribution as a dependency to pyproject.toml, I encountered this error.
Looks like python 2.7 compatibility issue.

@akarsh1995 akarsh1995 added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jun 28, 2020
@jacques-
Copy link

Same behaviour with poetry add /path/to/mylib. Can confirm this works as expected if I downgrade to poetry 1.0.8.

@mattstrayer
Copy link

mattstrayer commented Jul 2, 2020

Also happening (v1.0.9) with adding a local dep in tar.gz format.

Example:
poetry add packages/my-package-1.0.0.tar.gz

Downgrading to 1.0.8 and re-ran the above command & everything worked as expected.

@flyte
Copy link

flyte commented Aug 3, 2020

I was getting this issue, but since upgrading to v1.0.10 it's fixed.

@abn abn linked a pull request Aug 4, 2020 that will close this issue
2 tasks
@abn
Copy link
Member

abn commented Aug 4, 2020

Resolved with #2582

@abn abn closed this as completed Aug 4, 2020
@abn abn removed the status/triage This issue needs to be triaged label Aug 4, 2020
Copy link

github-actions bot commented Mar 3, 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 3, 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

Successfully merging a pull request may close this issue.

5 participants