Re: [Python-Dev] The desired behaviour for resolve() when the path doesn't exist

2014-02-16 Thread Vajrasky Kok
On Wed, Jan 8, 2014 at 4:45 AM, Serhiy Storchaka storch...@gmail.com wrote: --canonicalize is not strict. --canonicalize-existing is most strict and --canonicalize-missing is least strict. When you have a function which have non-strict behavior (--canonicalize), you can implement a wrapper with

Re: [Python-Dev] The desired behaviour for resolve() when the path doesn't exist

2014-01-07 Thread Serhiy Storchaka
06.01.14 12:38, Vajrasky Kok написав(ла): This is related with ticket 19717: resolve() fails when the path doesn't exist. Assuming /home/cutecat exists but not /home/cutecat/aa, what is the desired output of Path('/home/cutecat/aa/bb/cc').resolve(strict=False)? Should it be: /home/cutecat

Re: [Python-Dev] The desired behaviour for resolve() when the path doesn't exist

2014-01-07 Thread Antoine Pitrou
On Tue, 07 Jan 2014 17:26:20 +0200 Serhiy Storchaka storch...@gmail.com wrote: Behavior of --canonicalize-existing can be derived from --canonicalize, just check that resulting patch exists. But other modes can't be derived from --canonicalize-existing. def resolve_existing(path):

Re: [Python-Dev] The desired behaviour for resolve() when the path doesn't exist

2014-01-07 Thread Serhiy Storchaka
07.01.14 22:28, Antoine Pitrou написав(ла): So perhaps two main modes should be --canonicalize (default) and --canonicalize-missing (with missing=True)? That sounds reasonable. And I think strict should be the default. --canonicalize is not strict. --canonicalize-existing is most strict and

Re: [Python-Dev] The desired behaviour for resolve() when the path doesn't exist

2014-01-07 Thread Antoine Pitrou
On Tue, 07 Jan 2014 22:45:54 +0200 Serhiy Storchaka storch...@gmail.com wrote: 07.01.14 22:28, Antoine Pitrou написав(ла): So perhaps two main modes should be --canonicalize (default) and --canonicalize-missing (with missing=True)? That sounds reasonable. And I think strict should be the

[Python-Dev] The desired behaviour for resolve() when the path doesn't exist

2014-01-06 Thread Vajrasky Kok
Dear friends, This is related with ticket 19717: resolve() fails when the path doesn't exist. Assuming /home/cutecat exists but not /home/cutecat/aa, what is the desired output of Path('/home/cutecat/aa/bb/cc').resolve(strict=False)? Should it be: /home/cutecat (the existed path only),