Message205448
| Author |
serhiy.storchaka |
| Recipients |
pitrou, serhiy.storchaka |
| Date |
2013年12月07日.11:02:31 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1386414151.7.0.591578690469.issue19918@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
>>> import pathlib
>>> pathlib.PureWindowsPath('C:/Foo/Bar').relative_to('C:/Foo')
PureWindowsPath('Bar')
>>> pathlib.PureWindowsPath('C:/Foo/Bar').relative_to('C:/foo')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/serhiy/py/cpython/Lib/pathlib.py", line 797, in relative_to
.format(str(self), str(formatted)))
ValueError: 'C:\\Foo\\Bar' does not start with 'C:\\foo'
>>> pathlib.PureWindowsPath('C:/Foo/Bar').relative_to('c:/Foo')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/serhiy/py/cpython/Lib/pathlib.py", line 797, in relative_to
.format(str(self), str(formatted)))
ValueError: 'C:\\Foo\\Bar' does not start with 'c:\\Foo'
It also returns strange result when an argument is naked drive:
>>> pathlib.PureWindowsPath('C:/Foo/Bar').relative_to('C:')
PureWindowsPath('//Foo/Bar') |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2013年12月07日 11:02:31 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, pitrou |
| 2013年12月07日 11:02:31 | serhiy.storchaka | set | messageid: <1386414151.7.0.591578690469.issue19918@psf.upfronthosting.co.za> |
| 2013年12月07日 11:02:31 | serhiy.storchaka | link | issue19918 messages |
| 2013年12月07日 11:02:31 | serhiy.storchaka | create |
|