This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients SilentGhost, cool-RR, pitrou, serhiy.storchaka
Date 2016-10-30.10:03:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1477821805.31.0.76401446098.issue28560@psf.upfronthosting.co.za>
In-reply-to
Content
>>> from pathlib import Path
>>> p = Path('/foo/bar')
>>> Path('/foo') in p.parents
True
>>> Path('/spam') in p.parents
False
>>> p.parts[:2] == ('/', 'foo')
True
>>> p.parts[:2] == ('/', 'spam')
False
>>> p.relative_to('/foo')
PosixPath('bar')
>>> p.relative_to('/spam')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.5/pathlib.py", line 864, in relative_to
    .format(str(self), str(formatted)))
ValueError: '/foo/bar' does not start with '/spam'
History
Date User Action Args
2016-10-30 10:03:25serhiy.storchakasetrecipients: + serhiy.storchaka, pitrou, SilentGhost, cool-RR
2016-10-30 10:03:25serhiy.storchakasetmessageid: <1477821805.31.0.76401446098.issue28560@psf.upfronthosting.co.za>
2016-10-30 10:03:25serhiy.storchakalinkissue28560 messages
2016-10-30 10:03:25serhiy.storchakacreate