179
178
transport_list_registry.remove(scheme)
183
@deprecated_function(zero_ninety)
185
# TODO: jam 20060606 urls should only be ascii, or they should raise InvalidURL
186
if isinstance(url, unicode):
187
url = url.encode('utf-8')
188
(scheme, netloc, path, params,
189
query, fragment) = urlparse.urlparse(url, allow_fragments=False)
190
username = password = host = port = None
192
username, host = netloc.split('@', 1)
194
username, password = username.split(':', 1)
195
password = urllib.unquote(password)
196
username = urllib.unquote(username)
201
host, port = host.rsplit(':', 1)
205
# TODO: Should this be ConnectionError?
206
raise errors.TransportError(
207
'invalid port number %s in url:\n%s' % (port, url))
208
host = urllib.unquote(host)
210
path = urllib.unquote(path)
212
return (scheme, username, password, host, port, path)
215
181
class _CoalescedOffset(object):
216
182
"""A data container for keeping track of coalesced offsets."""
1540
1506
return transport
1543
@deprecated_function(zero_ninety)
1544
def urlescape(relpath):
1545
urlutils.escape(relpath)
1548
@deprecated_function(zero_ninety)
1549
def urlunescape(url):
1550
urlutils.unescape(url)
1552
1509
# We try to recognize an url lazily (ignoring user, password, etc)
1553
1510
_urlRE = re.compile(r'^(?P<proto>[^:/\\]+)://(?P<rest>.*)$')