mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Refs #28428 -- Made filepath_to_uri() support pathlib.Path.
This commit is contained in:
parent
4c762588ff
commit
6315a272c5
4 changed files with 16 additions and 2 deletions
|
@ -280,7 +280,8 @@ The functions defined in this module share the following properties:
|
|||
.. function:: filepath_to_uri(path)
|
||||
|
||||
Convert a file system path to a URI portion that is suitable for inclusion
|
||||
in a URL. The path is assumed to be either UTF-8 bytes or string.
|
||||
in a URL. The path is assumed to be either UTF-8 bytes, string, or a
|
||||
:class:`~pathlib.Path`.
|
||||
|
||||
This method will encode certain characters that would normally be
|
||||
recognized as special characters for URIs. Note that this method does not
|
||||
|
@ -289,6 +290,10 @@ The functions defined in this module share the following properties:
|
|||
|
||||
Returns an ASCII string containing the encoded result.
|
||||
|
||||
.. versionchanged:: 3.1
|
||||
|
||||
Support for :class:`pathlib.Path` ``path`` was added.
|
||||
|
||||
.. function:: escape_uri_path(path)
|
||||
|
||||
Escapes the unsafe characters from the path portion of a Uniform Resource
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue