[issue38924] pathlib paths .normalize()

2019-11-26 Thread Ionuț Ciocîrlan
New submission from Ionuț Ciocîrlan : pathlib paths should expose a `.normalize()` method. This is highly useful, especially in web-related scenarios. On `PurePath` its usefulness is obvious, but it's debatable for `Path`, as it would yield different results from `.resolve()` in case

[issue38924] pathlib paths .normalize()

2019-12-02 Thread Ionuț Ciocîrlan
Ionuț Ciocîrlan added the comment: Brett and Serhiy, you do realise there are no symlinks to resolve on PurePaths, right? > os.path.normpath() is broken by design. Why don't you deprecate it then? Sounds like the reasonable thing to do, no? So many innocent souls endangered by this e

[issue38924] pathlib paths .normalize()

2019-11-28 Thread Ionuț Ciocîrlan
Ionuț Ciocîrlan added the comment: > Can you please add an example of how normalize() should behave? ``` >>> mypath = PurePosixPath("foo/bar/bzz") >>> mypath /= "../../" >>> mypath PurePosixPath('foo/bar/bzz/../..') >>> mypath = my