New submission from Chris Jerdonek: 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. ---------- components: Library (Lib) messages: 232876 nosy: chris.jerdonek priority: normal severity: normal status: open title: pathlib relative_to() can give confusing error message type: behavior versions: Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue23082> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com