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 chris.jerdonek
Recipients chris.jerdonek
Date 2014-12-18.13:37:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1418909839.25.0.648032443428.issue23082@psf.upfronthosting.co.za>
In-reply-to
Content
pathlib's relative_to(other) can give a confusing message when "other" is os.curdir.

For example--

    Python 3.4.2 (default, Nov 12 2014, 18:23:59) 
    [GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.54)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import os
    >>> from pathlib import Path
    >>> Path("/foo").relative_to(os.curdir)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/opt/local/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/pathlib.py", line 806, in relative_to
        .format(str(self), str(formatted)))
    ValueError: '/foo' does not start with ''

I guess the error here is that the path must be relative when "other" is relative.
History
Date User Action Args
2014-12-18 13:37:19chris.jerdoneksetrecipients: + chris.jerdonek
2014-12-18 13:37:19chris.jerdoneksetmessageid: <1418909839.25.0.648032443428.issue23082@psf.upfronthosting.co.za>
2014-12-18 13:37:19chris.jerdoneklinkissue23082 messages
2014-12-18 13:37:18chris.jerdonekcreate