Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[1.5.X] Fixed #18718 - Documented django.utils.encoding.filepath_to_uri

Backport of 507c081 from master
  • Loading branch information...
commit 53b40d75b787b1f76e08aa078de88bae6473a3fc 1 parent 06b5f5f
@timgraham timgraham authored
Showing with 13 additions and 1 deletion.
  1. +1 −1  django/utils/encoding.py
  2. +12 −0 docs/ref/utils.txt
View
2  django/utils/encoding.py
@@ -216,7 +216,7 @@ def iri_to_uri(iri):
return quote(force_bytes(iri), safe=b"/#%[]=:;$&()+,!?*@'~")
def filepath_to_uri(path):
- """Convert an file system path to a URI portion that is suitable for
+ """Convert a file system path to a URI portion that is suitable for
inclusion in a URL.
We are assuming input is either UTF-8 or unicode already.
View
12 docs/ref/utils.txt
@@ -305,6 +305,18 @@ The functions defined in this module share the following properties:
Returns an ASCII string containing the encoded result.
+.. 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 or unicode.
+
+ This method will encode certain characters that would normally be
+ recognized as special characters for URIs. Note that this method does not
+ encode the ' character, as it is a valid character within URIs. See
+ ``encodeURIComponent()`` JavaScript function for more details.
+
+ Returns an ASCII string containing the encoded result.
+
``django.utils.feedgenerator``
==============================
Please sign in to comment.
Something went wrong with that request. Please try again.