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 John15321
Recipients John15321
Date 2022-03-30.11:01:51
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1648638112.11.0.570529320382.issue47161@roundup.psfhosted.org>
In-reply-to
Content
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 '/'
```
History
Date User Action Args
2022-03-30 11:01:52John15321setrecipients: + John15321
2022-03-30 11:01:52John15321setmessageid: <1648638112.11.0.570529320382.issue47161@roundup.psfhosted.org>
2022-03-30 11:01:52John15321linkissue47161 messages
2022-03-30 11:01:51John15321create