[issue40358] pathlib's relative_to should behave like os.path.relpath

2021-05-16 Thread Barney Gale
Barney Gale added the comment: Also requested in #42234. -- nosy: +barneygale ___ Python tracker ___ ___ Python-bugs-list mailing

[issue40358] pathlib's relative_to should behave like os.path.relpath

2021-05-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: On #44078 (closed as duplicate), Mark Hammond made a similar request. -- nosy: +terry.reedy versions: +Python 3.11 -Python 3.10 ___ Python tracker

[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-05-28 Thread Domenico Ragusa
Domenico Ragusa added the comment: I've solved the conflicts with GH-19611 (bpo-23082: Better error message for PurePath.relative_to() from pathlib) that was merged in the mean time and improved the documentation. Everything appears to be in order, can you take a look at it? --

[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-04-30 Thread Sanyam Khurana
Change by Sanyam Khurana : -- nosy: +CuriousLearner ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-04-30 Thread Domenico Ragusa
Change by Domenico Ragusa : -- pull_requests: +19133 pull_request: https://github.com/python/cpython/pull/19813 ___ Python tracker ___

[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-04-29 Thread Domenico Ragusa
Domenico Ragusa added the comment: I may have forgotten to use the proper format for the title of each commit, should I delete the pull request and make a new one or can it be fixed when (or if) it's pulled? On Thu, Apr 30, 2020 at 2:03 AM Roundup Robot wrote: > > > Change by Roundup Robot :

[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-04-29 Thread Roundup Robot
Change by Roundup Robot : -- nosy: +python-dev nosy_count: 5.0 -> 6.0 pull_requests: +19128 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19807 ___ Python tracker

[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-04-29 Thread Ammar Askar
Ammar Askar added the comment: Thank you for your work on this Domenico. For reviewing the code, would you mind creating a Github pull request for it as described here https://devguide.python.org/pullrequest/ -- nosy: +ammar2 ___ Python tracker

[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-04-27 Thread Domenico Ragusa
Domenico Ragusa added the comment: Yeah, you're right, there's no access to the filesystem and the result is generated assuming the paths are already resolved. `strict` seems to be an appropriate name for the option, thanks. I've looked into the test suite, it helped a lot especially with

[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-04-27 Thread Domenico Ragusa
Change by Domenico Ragusa : Removed file: https://bugs.python.org/file49081/pathlib.diff ___ Python tracker ___ ___ Python-bugs-list

[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-04-22 Thread Eryk Sun
Eryk Sun added the comment: Note that the implementation of relpath is pure and thus assumes it's working with existing, resolved paths (i.e. "the filesystem is not accessed to confirm the existence or nature of path or start"). For example: >>> os.path.relpath('/some/thing',

[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-04-22 Thread Domenico Ragusa
Domenico Ragusa added the comment: Thanks for your answer. Yeah, I'm new, I'm reading the guide, sorry for any faux pas :) Ok, an option would be great as well, a simple True/False switch? Any suggestion for the name? I'll get back with a proper patch this time. On Wed, Apr 22, 2020 at 8:18

[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-04-22 Thread Antoine Pitrou
Antoine Pitrou added the comment: The current behaviour is by design. I would not mind adding an option to control it, though. If you are new to Python development and want to submit a patch or PR, I recommend reading the Developer's Guide: https://devguide.python.org/ --

[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-04-21 Thread Bowie Chen
Change by Bowie Chen : -- nosy: +bowiechen ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-04-21 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue40358] pathlib's relative_to should behave like os.path.relpath

2020-04-21 Thread Domenico Ragusa
New submission from Domenico Ragusa : Can we improve pathlib.relative_to(other) so that it handles the case of a path not being a direct child of other, like os.path.relpath? For example: Path('/some/thing').relative_to('/foo') -> Path('../some/thing') At the moment it just raises an