[issue38793] pathlib.Path.resolve(strict=False) strips final path components

2019-11-14 Thread Brett Cannon
Change by Brett Cannon : -- nosy: +brett.cannon ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue38793] pathlib.Path.resolve(strict=False) strips final path components

2019-11-14 Thread Steve Dower
Steve Dower added the comment: If "a" exists in the current directory, I get this (correct) result: >>> import pathlib >>> p = pathlib.Path(".", "a", "b", "c") >>> p.resolve(strict=False) WindowsPath('/a/b/c') So there's an existence check of some kind that's not being handled properly.

[issue38793] pathlib.Path.resolve(strict=False) strips final path components

2019-11-14 Thread Steve Dower
Steve Dower added the comment: I'm not sure - I try the same thing (on 3.6, 3.7 and 3.8) and get different results: >>> import pathlib >>> p = pathlib.Path(".", "a", "b", "c") >>> p.resolve(strict=False) WindowsPath('a/b/c') Are you sure that it's not successfully resolving a link of some ki

[issue38793] pathlib.Path.resolve(strict=False) strips final path components

2019-11-14 Thread lutecki
New submission from lutecki : When a directory doesn't exist, the resolve() method trims everything except the first component (a doesn't exist here): import pathlib p = pathlib.Path(".", "a", "b", "c") p WindowsPath('a/b/c') p.resolve(strict=False) WindowsPath('C:/Python36/Scripts/a') I woul