Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed #18718 - Documented django.utils.encoding.filepath_to_uri

  • Loading branch information...
commit 507c0814847fe3637d23625cc6f26bf2cfa5f66f 1 parent bf14aed
Tim Graham authored December 16, 2012
2  django/utils/encoding.py
@@ -216,7 +216,7 @@ def iri_to_uri(iri):
216 216
     return quote(force_bytes(iri), safe=b"/#%[]=:;$&()+,!?*@'~")
217 217
 
218 218
 def filepath_to_uri(path):
219  
-    """Convert an file system path to a URI portion that is suitable for
  219
+    """Convert a file system path to a URI portion that is suitable for
220 220
     inclusion in a URL.
221 221
 
222 222
     We are assuming input is either UTF-8 or unicode already.
12  docs/ref/utils.txt
@@ -305,6 +305,18 @@ The functions defined in this module share the following properties:
305 305
 
306 306
     Returns an ASCII string containing the encoded result.
307 307
 
  308
+.. function:: filepath_to_uri(path)
  309
+
  310
+    Convert a file system path to a URI portion that is suitable for inclusion
  311
+    in a URL. The path is assumed to be either UTF-8 or unicode.
  312
+
  313
+    This method will encode certain characters that would normally be
  314
+    recognized as special characters for URIs.  Note that this method does not
  315
+    encode the ' character, as it is a valid character within URIs. See
  316
+    ``encodeURIComponent()`` JavaScript function for more details.
  317
+
  318
+    Returns an ASCII string containing the encoded result.
  319
+
308 320
 ``django.utils.feedgenerator``
309 321
 ==============================
310 322
 

0 notes on commit 507c081

Please sign in to comment.
Something went wrong with that request. Please try again.