bpo-33660: Fix PosixPath to resolve a relative path on root by corona10 · Pull Request #7666 · python/cpython

@corona10

@corona10 corona10 changed the title bpo-33660: Fix PosixPath to resolve a relative path on root [WIP} bpo-33660: Fix PosixPath to resolve a relative path on root

Jun 12, 2018

@corona10 corona10 changed the title [WIP} bpo-33660: Fix PosixPath to resolve a relative path on root bpo-33660: Fix PosixPath to resolve a relative path on root

Jun 12, 2018

@corona10

@pitrou Please take a look :)

There are 2 options to fix this bug.

if path == sep:
    newpath = sep + name
else:
    newpath = path + sep + name  

or

if path == '/':
    newpath = sep + name
else:
    newpath = path + sep + name  

I choose the first one.

@corona10

@corona10

@mbarkhau

@corona10 Can you clarify why this was closed? Perhaps in the issue?

@ambv ambv mentioned this pull request

Aug 26, 2020