mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
GH-123599: Deprecate duplicate pathname2url() implementation (#127380)
Call `urllib.request.pathname2url()` from `pathlib.Path.as_uri()`, and deprecate the duplicate implementation in `PurePath`. Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
parent
6c776abb90
commit
f141e8ec2a
5 changed files with 45 additions and 19 deletions
|
|
@ -886,9 +886,11 @@ conforming to :rfc:`8089`.
|
|||
>>> p.as_uri()
|
||||
'file:///c:/Windows'
|
||||
|
||||
For historical reasons, this method is also available from
|
||||
:class:`PurePath` objects. However, its use of :func:`os.fsencode` makes
|
||||
it strictly impure.
|
||||
.. deprecated-removed:: 3.14 3.19
|
||||
|
||||
Calling this method from :class:`PurePath` rather than :class:`Path` is
|
||||
possible but deprecated. The method's use of :func:`os.fsencode` makes
|
||||
it strictly impure.
|
||||
|
||||
|
||||
Expanding and resolving paths
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue