safe_url_string should not escape unreserved marks (see RFC 2396, sec

2.3)

--HG--
extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%40285
This commit is contained in:
olveyra 2008-09-30 14:15:23 +00:00
parent 3f32bae45f
commit a38c72bb05
1 changed files with 2 additions and 1 deletions

View File

@ -37,7 +37,8 @@ def urljoin_rfc(base, ref):
_reserved = ';/?:@&=+$|,#' # RFC 2396 (Generic Syntax)
_safe_chars = urllib.always_safe + '%' + _reserved
_unreserved_marks = "-_.!~*'()" #RFC 2396 sec 2.3
_safe_chars = urllib.always_safe + '%' + _reserved + _unreserved_marks
def safe_url_string(url, use_encoding='utf8'):
"""Convert a unicode (or utf8 string) object into a legal URL.