updated some RFC numbers

This commit is contained in:
Pablo Hoffman 2009-08-15 20:54:34 -03:00
parent 08424ee093
commit f1980a3d9f
1 changed files with 3 additions and 3 deletions

View File

@ -36,13 +36,13 @@ def urljoin_rfc(base, ref, encoding='utf-8'):
return urlparse.urljoin(unicode_to_str(base, encoding), \
unicode_to_str(ref, encoding))
_reserved = ';/?:@&=+$|,#' # RFC 2396 (Generic Syntax)
_unreserved_marks = "-_.!~*'()" # RFC 2396 sec 2.3
_reserved = ';/?:@&=+$|,#' # RFC 3986 (Generic Syntax)
_unreserved_marks = "-_.!~*'()" # RFC 3986 sec 2.3
_safe_chars = urllib.always_safe + '%' + _reserved + _unreserved_marks
def safe_url_string(url, encoding='utf8'):
"""Convert the given url into a legal URL by escaping unsafe characters
according to RFC-2396.
according to RFC-3986.
If a unicode url is given, it is first converted to str using the given
encoding (which defaults to 'utf-8'). When passing a encoding, you should