Re: [Python-ideas] Three ways of paths canonization

2016-09-08 Thread Brett Cannon
On Thu, 8 Sep 2016 at 09:46 Guido van Rossum wrote: > I would prefer it if Path.resolve() resolved symlinks until it hits > something that doesn't exist and then just keep the rest of the path > unchanged. I think this is the equivalent of -m in the mentioned > utility (which I had never heard of

Re: [Python-ideas] Three ways of paths canonization

2016-09-08 Thread Guido van Rossum
I would prefer it if Path.resolve() resolved symlinks until it hits something that doesn't exist and then just keep the rest of the path unchanged. I think this is the equivalent of -m in the mentioned utility (which I had never heard of). It looks like os.path.realpath() already works this way.

Re: [Python-ideas] Three ways of paths canonization

2016-09-08 Thread Koos Zevenhoven
On Wed, Sep 7, 2016 at 12:20 PM, Serhiy Storchaka wrote: > Before removing provisional state from the pathlib module, we should resolve > the issue with Path.resolve(). It corresponds to os.path.realpath(), but > behaves differently in case of non-existent path. Actually we can't say that > any of

[Python-ideas] Three ways of paths canonization

2016-09-07 Thread Stephen J. Turnbull
Serhiy Storchaka writes: > The readlink utility from GNU coreutils has three mode for resolving > file path: > > -f, --canonicalize >canonicalize by following every symlink in every > component of the given name recursively; all but the last component must > exis

[Python-ideas] Three ways of paths canonization

2016-09-07 Thread Serhiy Storchaka
Before removing provisional state from the pathlib module, we should resolve the issue with Path.resolve(). It corresponds to os.path.realpath(), but behaves differently in case of non-existent path. Actually we can't say that any of these functions is wrong. Both behaviors make sense in differ