Message232876
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. |
|
Date |
User |
Action |
Args |
2014-12-18 13:37:19 | chris.jerdonek | set | recipients:
+ chris.jerdonek |
2014-12-18 13:37:19 | chris.jerdonek | set | messageid: <1418909839.25.0.648032443428.issue23082@psf.upfronthosting.co.za> |
2014-12-18 13:37:19 | chris.jerdonek | link | issue23082 messages |
2014-12-18 13:37:18 | chris.jerdonek | create | |
|