Skip to content

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

@akarsh1995

Description

@akarsh1995
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions