Message416336
The `//` path should be equivalent to `/`, and in some ways, it does behave like that in pathlib. But in the `relative_to` method on a `Path` object, it does not work
This is causing our CI pipeline to fail. In the documentation here you can see `//` being properly processed:
https://docs.python.org/3/library/pathlib.html
```python
In [10]: x=Path("/Library/Video") ; x.relative_to(Path("/"))
Out[10]: PosixPath('Library/Video')
In [11]: x=Path("//Library/Video") ; x.relative_to(Path("/"))
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Input In [11], in <cell line: 1>()
----> 1 x=Path("//Library/Video") ; x.relative_to(Path("/"))
File ~/.pyenv/versions/3.8.13/lib/python3.8/pathlib.py:908, in PurePath.relative_to(self, *other)
906 if (root or drv) if n == 0 else cf(abs_parts[:n]) != cf(to_abs_parts):
907 formatted = self._format_parsed_parts(to_drv, to_root, to_parts)
--> 908 raise ValueError("{!r} does not start with {!r}"
909 .format(str(self), str(formatted)))
910 return self._from_parsed_parts('', root if n == 1 else '',
911 abs_parts[n:])
ValueError: '//Library/Video' does not start with '/'
``` |
|
Date |
User |
Action |
Args |
2022-03-30 11:01:52 | John15321 | set | recipients:
+ John15321 |
2022-03-30 11:01:52 | John15321 | set | messageid: <1648638112.11.0.570529320382.issue47161@roundup.psfhosted.org> |
2022-03-30 11:01:52 | John15321 | link | issue47161 messages |
2022-03-30 11:01:51 | John15321 | create | |
|