<div>Hi,<br></div><div><br></div><div>Thanks for reporting, this is due to the resolution of <a href="https://bugs.python.org/issue19717">https://bugs.python.org/issue19717</a>, I opened a PR to explicitly tell about it in the documentation: <a href="https://github.com/python/cpython/pull/11316">https://github.com/python/cpython/pull/11316</a><br></div><div><br></div><div>Can you proofread it?<br></div><div><br></div><div>Bests,<br></div><div class="protonmail_signature_block"><div class="protonmail_signature_block-user"><div>-- <br></div><div>Julien Palard<br></div><div>https://mdk.fr<br></div></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><br></div></div><div><br></div><div>‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐<br></div><div> On Thursday 13 December 2018 10:54, Laurens Duijvesteijn <laurens@channable.com> wrote:<br></div><div> <br></div><blockquote type="cite" class="protonmail_quote"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div>Hi,<br></div><div><br></div><div>The `Path.resolve()` method behaves differently on Python 3.5 vs Python 3.6.<br></div><div><br></div><div>The docs <a href="https://docs.python.org/3/library/pathlib.html#pathlib.Path.resolve" target="_blank">https://docs.python.org/3/library/pathlib.html#pathlib.Path.resolve</a><br></div><div>fail to mention this.<br></div><div><br></div><div>This is the behavior on 3.5:<br></div><div><br></div><div>```<br></div><div><div>Python 3.5.2 (default, Nov 12 2018, 13:43:14)<br></div><div>[GCC 5.4.0 20160609] on linux<br></div><div>Type "help", "copyright", "credits" or "license" for more information.<br></div><div>>>> from pathlib import Path<br></div><div>>>> p = Path('/var/../doesnotexist.txt')<br></div><div>>>> p.resolve()<br></div><div>Traceback (most recent call last):<br></div><div>  File "<stdin>", line 1, in <module><br></div><div>  File "/usr/lib/python3.5/pathlib.py", line 1109, in resolve<br></div><div>    s = self._flavour.resolve(self)<br></div><div>  File "/usr/lib/python3.5/pathlib.py", line 330, in resolve<br></div><div>    return _resolve(base, str(path)) or sep<br></div><div>  File "/usr/lib/python3.5/pathlib.py", line 315, in _resolve<br></div><div>    target = accessor.readlink(newpath)<br></div><div>  File "/usr/lib/python3.5/pathlib.py", line 422, in readlink<br></div><div>    return os.readlink(path)<br></div><div>FileNotFoundError: [Errno 2] No such file or directory: '/doesnotexist.txt'<br></div></div><div>```<br></div><div><br></div><div>This is the behavior on 3.6:<br></div><div><br></div><div><div>```<br></div><div>Python 3.6.6 (default, Sep 12 2018, 18:26:19)<br></div><div>[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]] on linux<br></div><div>Type "help", "copyright", "credits" or "license" for more information.<br></div><div>>>> from pathlib import Path<br></div><div>>>> p = Path('/var/../doesnotexist.txt')<br></div><div>>>> p.resolve()<br></div><div>PosixPath('/doesnotexist.txt')<br></div><div>```<br></div></div><div><br></div><div>I'd even say this change is a bug in the standard lib (if done on purpose,<br></div><div>it is not listed as a backwards incompatible change in the release notes,<br></div><div>didn't dig further).<br></div><div><br></div><div>The docs mention "New in version 3.6: The strict argument". IMO the docs <br></div><div>should also mention that before 3.5, this method would raise FileNotFound<br></div><div>by default.<br></div><div><br></div><div>Thanks and kind regards,<br></div><div>Laurens Duijvesteijn<br></div></div></div></div></div></div></blockquote><div><br></div>