[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-12 Thread Ned Deily

Ned Deily added the comment:


New changeset a77a35d70ba8aed047e63d4d9f7d0554e98d4c4b by Ned Deily (Antoine 
Pietri) in branch 'master':
bpo-30177: add NEWS entry (#2135)
https://github.com/python/cpython/commit/a77a35d70ba8aed047e63d4d9f7d0554e98d4c4b


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-12 Thread Antoine Pietri

Changes by Antoine Pietri :


--
pull_requests: +2189

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-12 Thread Ned Deily

Ned Deily added the comment:


New changeset 8399a177de8bfa860a66e96665488c17199cb9d2 by Ned Deily (Antoine 
Pietri) in branch '3.6':
[3.6] bpo-30177: add NEWS entry (#2134)
https://github.com/python/cpython/commit/8399a177de8bfa860a66e96665488c17199cb9d2


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-12 Thread Antoine Pietri

Changes by Antoine Pietri :


--
pull_requests: +2188

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-07 Thread Steve Dower

Steve Dower added the comment:

Good point about not needing 3.5.

Buildbots were clean, so I merged it. Thanks Antoine!

--
resolution:  -> fixed
stage: backport needed -> resolved
status: open -> closed
versions:  -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-07 Thread Steve Dower

Steve Dower added the comment:


New changeset ceabf9acf03f9bbe660d856bff90ecab475ab543 by Steve Dower (Antoine 
Pietri) in branch '3.6':
bpo-30177: pathlib: include the full path in resolve(strict=False) (#1893) 
(#1985)
https://github.com/python/cpython/commit/ceabf9acf03f9bbe660d856bff90ecab475ab543


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-07 Thread Antoine Pietri

Antoine Pietri added the comment:

The only backport was for 3.6 as the previous versions don't have the strict= 
parameter. PR submitted here: https://github.com/python/cpython/pull/1985

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-07 Thread Antoine Pietri

Changes by Antoine Pietri :


--
pull_requests: +2052

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-07 Thread Steve Dower

Steve Dower added the comment:


New changeset add98eb4fe41baeaa70fbd4ccc020833740609a4 by Steve Dower (Antoine 
Pietri) in branch 'master':
bpo-30177: pathlib: include the full path in resolve(strict=False) (#1893)
https://github.com/python/cpython/commit/add98eb4fe41baeaa70fbd4ccc020833740609a4


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-07 Thread Steve Dower

Steve Dower added the comment:

As usual, I can easily hit merge but may not be able to get to the backport 
immediately. Someone else can feel free to cherrypick and submit the PRs and 
I'll hit merge on them.

We should also watch the buildbots for failures though before backporting. 
Particularly in this area, they should have better coverage than the PR checks.

--
stage:  -> backport needed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-06 Thread Antoine Pietri

Antoine Pietri added the comment:

The code has been reviewed by (the other) Antoine, I guess there is now 
everything needed to merge it?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-05 Thread Antoine Pietri

Antoine Pietri added the comment:

I updated the PR to fix the Windows part of the issue thanks to Zachary who 
gave me access to a Windows machine.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-06-01 Thread Antoine Pietri

Antoine Pietri added the comment:

So, I asked a friend to check again with a more recent Python version on 
Windows and he can't reproduce the documented behavior, so the bug seems to 
also be present on Windows. My patch doesn't address that for now, which 
explains why the build fails (and why it was working before).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-05-31 Thread Zachary Ware

Zachary Ware added the comment:

> do we have any buildbots running as admin for symlink tests?

No, as far as I know.  I just took Eryk's suggestion and gave the buildslave 
user on my Windows 8.1 bot rights to create symbolic links, though.  It's now 
rebooting after updates, we'll see how it does shortly.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-05-31 Thread Eryk Sun

Eryk Sun added the comment:

> Ah, looks like they require symlinks for the whole test, 
> which means you need to be admin when running them on Windows.

The privilege to create symlinks isn't filtered out of a standard user's token. 
Are there any buildbots already running as a standard user? In that case it may 
be simpler to modify the user's rights via secpol.msc: Local Policies -> User 
Rights Assignment -> Create symbolic links.

Support could also be added for the new feature in Windows 10 to allow 
unprivileged creation of symlinks when the system is in developer mode and the 
flag SYMBOLIC_LINK_FLAG_ALLOW_UNPRIVILEGED_CREATE [1] is used. A keyword-only 
option to use this flag could be backported to 3.6 and enabled by default in 
3.7.

[1]: https://blogs.windows.com/buildingapps/2016/12/02/symlinks-windows-10

--
nosy: +eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-05-31 Thread Antoine Pietri

Antoine Pietri added the comment:

I added a fix for the tests and the code.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-05-31 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +1969

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-05-31 Thread Steve Dower

Steve Dower added the comment:

Ah, looks like they require symlinks for the whole test, which means you need 
to be admin when running them on Windows.

Zach - do we have any buildbots running as admin for symlink tests?

--
nosy: +zach.ware

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-05-31 Thread Steve Dower

Steve Dower added the comment:

The initial fix should be easy:

--- a/Lib/pathlib.py
+++ b/Lib/pathlib.py
@@ -329,8 +329,6 @@ class _PosixFlavour(_Flavour):
 if e.errno != EINVAL:
 if strict:
 raise
-else:
-return newpath
 # Not a symlink
 path = newpath

However, the trick is going to be in the tests, which are shared between POSIX 
and Windows - and are apparently passing on Windows right now. I'm not entirely 
sure why that is, but it may not be as simple here as "works on POSIX".

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-05-31 Thread Antoine Pietri

Antoine Pietri added the comment:

I'm on it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-05-31 Thread Ned Deily

Ned Deily added the comment:

We have less than 2 weeks until cutoff for 3.6.2 so it would be great if 
someone would take this on.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-05-31 Thread Zopieux

Zopieux added the comment:

I agree bpo-30177 is not a suitable fix for this issue, as it fixes the doc 
instead of fixing the actual underlying bug in the function behavior.

This bug can lead to files being added to the wrong (parent) directory, which 
is quite critical.

--
nosy: +zopieux

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-05-31 Thread Steve Dower

Steve Dower added the comment:

Ah, didn't catch that it doesn't occur on Windows - that explains why I've 
never seen it before.

Yes, definitely fix and backport. Adding the RMs in case they want to delay any 
upcoming releases to get the fix.

--
nosy: +larry, ned.deily
priority: normal -> critical

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-05-31 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This is definitely a bug and I think the fixes should be backported.

--
versions: +Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-05-31 Thread Antoine Pietri

Antoine Pietri added the comment:

By the way, I'm pasting what I said on the PR here: 

For what it's worth, this bug was the cause of an important downtime in our 
organization, because someone needed to normalize a path that was later passed 
to a .mkdir(parents=True), and it was, in some cases, silently doing the mkdir 
of a wrong path instead of creating all the parents.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-05-31 Thread Steve Dower

Steve Dower added the comment:

This is definitely a bug if it really behaves as described.

PRs for fixing the functionality are welcome - I'm inclined to say fix it in 
3.6 as well, but it might be too big a behavioural change if people are already 
working around it.

--
nosy: +steve.dower

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-05-31 Thread Antoine Pietri

Antoine Pietri added the comment:

In Windows/Python 3.6, the behavior matches the documented one, so this could 
actually be an important silent bug when executing a code wrote for Windows in 
another OS. I'd argue to fix it in 3.6 too.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-05-28 Thread Richard Cooper

Richard Cooper added the comment:

Pull Request (PR 1649) treats this as a documentation problem. I would argue 
that the documentation is correct and this is a bug in the code.

The `strict` flag was added as a result of issue19717. The decision on what to 
do when strict=False seems to come in 
https://mail.python.org/pipermail/python-ideas/2016-September/042203.html where 
Guido says:

"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."

The documented behaviour also seems much more useful than the current behaviour.

--
nosy: +richardc

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-05-18 Thread Marcel Plch

Changes by Marcel Plch :


--
pull_requests: +1744

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-04-30 Thread Antoine Pietri

Antoine Pietri added the comment:

I can reproduce this bug. This behavior is really confusing.

--
nosy: +seirl

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-04-26 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +pitrou, serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30177] pathlib.resolve(strict=False) only includes first child

2017-04-26 Thread Michael Shuffett

New submission from Michael Shuffett:

According to the documentation 
https://docs.python.org/3/library/pathlib.html#pathlib.Path.resolve
If strict is False, the path is resolved as far as possible and any remainder 
is appended without checking whether it exists.

The current behavior is not consistent with this, and only appends the first 
remainder.

For example:
If we have an empty '/tmp' directory
Path('/tmp/foo').resolve() and Path('/tmp/foo/bar').resolve() both result in 
Path('/tmp/foo') but Path('/tmp/foo/bar').resolve() should result in 
Path('/tmp/foo/bar')

--
components: Library (Lib)
messages: 292369
nosy: mshuffett
priority: normal
severity: normal
status: open
title: pathlib.resolve(strict=False) only includes first child
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com