##// END OF EJS Templates
ssl: fix compatibility with pre-2.6 Python
Matt Mackall -
r10411:af4c42ec default
parent child Browse files
Show More
@@ -1,614 +1,614 b''
1 1 # url.py - HTTP handling for mercurial
2 2 #
3 3 # Copyright 2005, 2006, 2007, 2008 Matt Mackall <mpm@selenic.com>
4 4 # Copyright 2006, 2007 Alexis S. L. Carvalho <alexis@cecm.usp.br>
5 5 # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
6 6 #
7 7 # This software may be used and distributed according to the terms of the
8 8 # GNU General Public License version 2 or any later version.
9 9
10 10 import urllib, urllib2, urlparse, httplib, os, re, socket, cStringIO
11 11 from i18n import _
12 12 import keepalive, util
13 13
14 14 def hidepassword(url):
15 15 '''hide user credential in a url string'''
16 16 scheme, netloc, path, params, query, fragment = urlparse.urlparse(url)
17 17 netloc = re.sub('([^:]*):([^@]*)@(.*)', r'\1:***@\3', netloc)
18 18 return urlparse.urlunparse((scheme, netloc, path, params, query, fragment))
19 19
20 20 def removeauth(url):
21 21 '''remove all authentication information from a url string'''
22 22 scheme, netloc, path, params, query, fragment = urlparse.urlparse(url)
23 23 netloc = netloc[netloc.find('@')+1:]
24 24 return urlparse.urlunparse((scheme, netloc, path, params, query, fragment))
25 25
26 26 def netlocsplit(netloc):
27 27 '''split [user[:passwd]@]host[:port] into 4-tuple.'''
28 28
29 29 a = netloc.find('@')
30 30 if a == -1:
31 31 user, passwd = None, None
32 32 else:
33 33 userpass, netloc = netloc[:a], netloc[a + 1:]
34 34 c = userpass.find(':')
35 35 if c == -1:
36 36 user, passwd = urllib.unquote(userpass), None
37 37 else:
38 38 user = urllib.unquote(userpass[:c])
39 39 passwd = urllib.unquote(userpass[c + 1:])
40 40 c = netloc.find(':')
41 41 if c == -1:
42 42 host, port = netloc, None
43 43 else:
44 44 host, port = netloc[:c], netloc[c + 1:]
45 45 return host, port, user, passwd
46 46
47 47 def netlocunsplit(host, port, user=None, passwd=None):
48 48 '''turn host, port, user, passwd into [user[:passwd]@]host[:port].'''
49 49 if port:
50 50 hostport = host + ':' + port
51 51 else:
52 52 hostport = host
53 53 if user:
54 54 if passwd:
55 55 userpass = urllib.quote(user) + ':' + urllib.quote(passwd)
56 56 else:
57 57 userpass = urllib.quote(user)
58 58 return userpass + '@' + hostport
59 59 return hostport
60 60
61 61 _safe = ('abcdefghijklmnopqrstuvwxyz'
62 62 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
63 63 '0123456789' '_.-/')
64 64 _safeset = None
65 65 _hex = None
66 66 def quotepath(path):
67 67 '''quote the path part of a URL
68 68
69 69 This is similar to urllib.quote, but it also tries to avoid
70 70 quoting things twice (inspired by wget):
71 71
72 72 >>> quotepath('abc def')
73 73 'abc%20def'
74 74 >>> quotepath('abc%20def')
75 75 'abc%20def'
76 76 >>> quotepath('abc%20 def')
77 77 'abc%20%20def'
78 78 >>> quotepath('abc def%20')
79 79 'abc%20def%20'
80 80 >>> quotepath('abc def%2')
81 81 'abc%20def%252'
82 82 >>> quotepath('abc def%')
83 83 'abc%20def%25'
84 84 '''
85 85 global _safeset, _hex
86 86 if _safeset is None:
87 87 _safeset = set(_safe)
88 88 _hex = set('abcdefABCDEF0123456789')
89 89 l = list(path)
90 90 for i in xrange(len(l)):
91 91 c = l[i]
92 92 if (c == '%' and i + 2 < len(l) and
93 93 l[i + 1] in _hex and l[i + 2] in _hex):
94 94 pass
95 95 elif c not in _safeset:
96 96 l[i] = '%%%02X' % ord(c)
97 97 return ''.join(l)
98 98
99 99 class passwordmgr(urllib2.HTTPPasswordMgrWithDefaultRealm):
100 100 def __init__(self, ui):
101 101 urllib2.HTTPPasswordMgrWithDefaultRealm.__init__(self)
102 102 self.ui = ui
103 103
104 104 def find_user_password(self, realm, authuri):
105 105 authinfo = urllib2.HTTPPasswordMgrWithDefaultRealm.find_user_password(
106 106 self, realm, authuri)
107 107 user, passwd = authinfo
108 108 if user and passwd:
109 109 self._writedebug(user, passwd)
110 110 return (user, passwd)
111 111
112 112 if not user:
113 113 auth = self.readauthtoken(authuri)
114 114 if auth:
115 115 user, passwd = auth.get('username'), auth.get('password')
116 116 if not user or not passwd:
117 117 if not self.ui.interactive():
118 118 raise util.Abort(_('http authorization required'))
119 119
120 120 self.ui.write(_("http authorization required\n"))
121 121 self.ui.status(_("realm: %s\n") % realm)
122 122 if user:
123 123 self.ui.status(_("user: %s\n") % user)
124 124 else:
125 125 user = self.ui.prompt(_("user:"), default=None)
126 126
127 127 if not passwd:
128 128 passwd = self.ui.getpass()
129 129
130 130 self.add_password(realm, authuri, user, passwd)
131 131 self._writedebug(user, passwd)
132 132 return (user, passwd)
133 133
134 134 def _writedebug(self, user, passwd):
135 135 msg = _('http auth: user %s, password %s\n')
136 136 self.ui.debug(msg % (user, passwd and '*' * len(passwd) or 'not set'))
137 137
138 138 def readauthtoken(self, uri):
139 139 # Read configuration
140 140 config = dict()
141 141 for key, val in self.ui.configitems('auth'):
142 142 group, setting = key.split('.', 1)
143 143 gdict = config.setdefault(group, dict())
144 144 gdict[setting] = val
145 145
146 146 # Find the best match
147 147 scheme, hostpath = uri.split('://', 1)
148 148 bestlen = 0
149 149 bestauth = None
150 150 for auth in config.itervalues():
151 151 prefix = auth.get('prefix')
152 152 if not prefix:
153 153 continue
154 154 p = prefix.split('://', 1)
155 155 if len(p) > 1:
156 156 schemes, prefix = [p[0]], p[1]
157 157 else:
158 158 schemes = (auth.get('schemes') or 'https').split()
159 159 if (prefix == '*' or hostpath.startswith(prefix)) and \
160 160 len(prefix) > bestlen and scheme in schemes:
161 161 bestlen = len(prefix)
162 162 bestauth = auth
163 163 return bestauth
164 164
165 165 class proxyhandler(urllib2.ProxyHandler):
166 166 def __init__(self, ui):
167 167 proxyurl = ui.config("http_proxy", "host") or os.getenv('http_proxy')
168 168 # XXX proxyauthinfo = None
169 169
170 170 if proxyurl:
171 171 # proxy can be proper url or host[:port]
172 172 if not (proxyurl.startswith('http:') or
173 173 proxyurl.startswith('https:')):
174 174 proxyurl = 'http://' + proxyurl + '/'
175 175 snpqf = urlparse.urlsplit(proxyurl)
176 176 proxyscheme, proxynetloc, proxypath, proxyquery, proxyfrag = snpqf
177 177 hpup = netlocsplit(proxynetloc)
178 178
179 179 proxyhost, proxyport, proxyuser, proxypasswd = hpup
180 180 if not proxyuser:
181 181 proxyuser = ui.config("http_proxy", "user")
182 182 proxypasswd = ui.config("http_proxy", "passwd")
183 183
184 184 # see if we should use a proxy for this url
185 185 no_list = ["localhost", "127.0.0.1"]
186 186 no_list.extend([p.lower() for
187 187 p in ui.configlist("http_proxy", "no")])
188 188 no_list.extend([p.strip().lower() for
189 189 p in os.getenv("no_proxy", '').split(',')
190 190 if p.strip()])
191 191 # "http_proxy.always" config is for running tests on localhost
192 192 if ui.configbool("http_proxy", "always"):
193 193 self.no_list = []
194 194 else:
195 195 self.no_list = no_list
196 196
197 197 proxyurl = urlparse.urlunsplit((
198 198 proxyscheme, netlocunsplit(proxyhost, proxyport,
199 199 proxyuser, proxypasswd or ''),
200 200 proxypath, proxyquery, proxyfrag))
201 201 proxies = {'http': proxyurl, 'https': proxyurl}
202 202 ui.debug('proxying through http://%s:%s\n' %
203 203 (proxyhost, proxyport))
204 204 else:
205 205 proxies = {}
206 206
207 207 # urllib2 takes proxy values from the environment and those
208 208 # will take precedence if found, so drop them
209 209 for env in ["HTTP_PROXY", "http_proxy", "no_proxy"]:
210 210 try:
211 211 if env in os.environ:
212 212 del os.environ[env]
213 213 except OSError:
214 214 pass
215 215
216 216 urllib2.ProxyHandler.__init__(self, proxies)
217 217 self.ui = ui
218 218
219 219 def proxy_open(self, req, proxy, type_):
220 220 host = req.get_host().split(':')[0]
221 221 if host in self.no_list:
222 222 return None
223 223
224 224 # work around a bug in Python < 2.4.2
225 225 # (it leaves a "\n" at the end of Proxy-authorization headers)
226 226 baseclass = req.__class__
227 227 class _request(baseclass):
228 228 def add_header(self, key, val):
229 229 if key.lower() == 'proxy-authorization':
230 230 val = val.strip()
231 231 return baseclass.add_header(self, key, val)
232 232 req.__class__ = _request
233 233
234 234 return urllib2.ProxyHandler.proxy_open(self, req, proxy, type_)
235 235
236 236 class httpsendfile(file):
237 237 def __len__(self):
238 238 return os.fstat(self.fileno()).st_size
239 239
240 240 def _gen_sendfile(connection):
241 241 def _sendfile(self, data):
242 242 # send a file
243 243 if isinstance(data, httpsendfile):
244 244 # if auth required, some data sent twice, so rewind here
245 245 data.seek(0)
246 246 for chunk in util.filechunkiter(data):
247 247 connection.send(self, chunk)
248 248 else:
249 249 connection.send(self, data)
250 250 return _sendfile
251 251
252 252 has_https = hasattr(urllib2, 'HTTPSHandler')
253 253 if has_https:
254 254 try:
255 255 # avoid using deprecated/broken FakeSocket in python 2.6
256 256 import ssl
257 257 _ssl_wrap_socket = ssl.wrap_socket
258 258 CERT_REQUIRED = ssl.CERT_REQUIRED
259 259 except ImportError:
260 260 CERT_REQUIRED = 2
261 261
262 262 def _ssl_wrap_socket(sock, key_file, cert_file,
263 263 cert_reqs=CERT_REQUIRED, ca_certs=None):
264 264 if ca_certs:
265 265 raise util.Abort(_(
266 266 'certificate checking requires Python 2.6'))
267 267
268 268 ssl = socket.ssl(sock, key_file, cert_file)
269 269 return httplib.FakeSocket(sock, ssl)
270 270
271 271 _GLOBAL_DEFAULT_TIMEOUT = object()
272 272
273 273 try:
274 274 _create_connection = socket.create_connection
275 except ImportError:
275 except AttributeError:
276 276 def _create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
277 277 source_address=None):
278 278 # lifted from Python 2.6
279 279
280 280 msg = "getaddrinfo returns an empty list"
281 281 host, port = address
282 282 for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM):
283 283 af, socktype, proto, canonname, sa = res
284 284 sock = None
285 285 try:
286 286 sock = socket.socket(af, socktype, proto)
287 287 if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
288 288 sock.settimeout(timeout)
289 289 if source_address:
290 290 sock.bind(source_address)
291 291 sock.connect(sa)
292 292 return sock
293 293
294 294 except socket.error, msg:
295 295 if sock is not None:
296 296 sock.close()
297 297
298 298 raise socket.error, msg
299 299
300 300 class httpconnection(keepalive.HTTPConnection):
301 301 # must be able to send big bundle as stream.
302 302 send = _gen_sendfile(keepalive.HTTPConnection)
303 303
304 304 def connect(self):
305 305 if has_https and self.realhost: # use CONNECT proxy
306 306 self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
307 307 self.sock.connect((self.host, self.port))
308 308 if _generic_proxytunnel(self):
309 309 # we do not support client x509 certificates
310 310 self.sock = _ssl_wrap_socket(self.sock, None, None)
311 311 else:
312 312 keepalive.HTTPConnection.connect(self)
313 313
314 314 def getresponse(self):
315 315 proxyres = getattr(self, 'proxyres', None)
316 316 if proxyres:
317 317 if proxyres.will_close:
318 318 self.close()
319 319 self.proxyres = None
320 320 return proxyres
321 321 return keepalive.HTTPConnection.getresponse(self)
322 322
323 323 # general transaction handler to support different ways to handle
324 324 # HTTPS proxying before and after Python 2.6.3.
325 325 def _generic_start_transaction(handler, h, req):
326 326 if hasattr(req, '_tunnel_host') and req._tunnel_host:
327 327 tunnel_host = req._tunnel_host
328 328 if tunnel_host[:7] not in ['http://', 'https:/']:
329 329 tunnel_host = 'https://' + tunnel_host
330 330 new_tunnel = True
331 331 else:
332 332 tunnel_host = req.get_selector()
333 333 new_tunnel = False
334 334
335 335 if new_tunnel or tunnel_host == req.get_full_url(): # has proxy
336 336 urlparts = urlparse.urlparse(tunnel_host)
337 337 if new_tunnel or urlparts[0] == 'https': # only use CONNECT for HTTPS
338 338 if ':' in urlparts[1]:
339 339 realhost, realport = urlparts[1].split(':')
340 340 realport = int(realport)
341 341 else:
342 342 realhost = urlparts[1]
343 343 realport = 443
344 344
345 345 h.realhost = realhost
346 346 h.realport = realport
347 347 h.headers = req.headers.copy()
348 348 h.headers.update(handler.parent.addheaders)
349 349 return
350 350
351 351 h.realhost = None
352 352 h.realport = None
353 353 h.headers = None
354 354
355 355 def _generic_proxytunnel(self):
356 356 proxyheaders = dict(
357 357 [(x, self.headers[x]) for x in self.headers
358 358 if x.lower().startswith('proxy-')])
359 359 self._set_hostport(self.host, self.port)
360 360 self.send('CONNECT %s:%d HTTP/1.0\r\n' % (self.realhost, self.realport))
361 361 for header in proxyheaders.iteritems():
362 362 self.send('%s: %s\r\n' % header)
363 363 self.send('\r\n')
364 364
365 365 # majority of the following code is duplicated from
366 366 # httplib.HTTPConnection as there are no adequate places to
367 367 # override functions to provide the needed functionality
368 368 res = self.response_class(self.sock,
369 369 strict=self.strict,
370 370 method=self._method)
371 371
372 372 while True:
373 373 version, status, reason = res._read_status()
374 374 if status != httplib.CONTINUE:
375 375 break
376 376 while True:
377 377 skip = res.fp.readline().strip()
378 378 if not skip:
379 379 break
380 380 res.status = status
381 381 res.reason = reason.strip()
382 382
383 383 if res.status == 200:
384 384 while True:
385 385 line = res.fp.readline()
386 386 if line == '\r\n':
387 387 break
388 388 return True
389 389
390 390 if version == 'HTTP/1.0':
391 391 res.version = 10
392 392 elif version.startswith('HTTP/1.'):
393 393 res.version = 11
394 394 elif version == 'HTTP/0.9':
395 395 res.version = 9
396 396 else:
397 397 raise httplib.UnknownProtocol(version)
398 398
399 399 if res.version == 9:
400 400 res.length = None
401 401 res.chunked = 0
402 402 res.will_close = 1
403 403 res.msg = httplib.HTTPMessage(cStringIO.StringIO())
404 404 return False
405 405
406 406 res.msg = httplib.HTTPMessage(res.fp)
407 407 res.msg.fp = None
408 408
409 409 # are we using the chunked-style of transfer encoding?
410 410 trenc = res.msg.getheader('transfer-encoding')
411 411 if trenc and trenc.lower() == "chunked":
412 412 res.chunked = 1
413 413 res.chunk_left = None
414 414 else:
415 415 res.chunked = 0
416 416
417 417 # will the connection close at the end of the response?
418 418 res.will_close = res._check_close()
419 419
420 420 # do we have a Content-Length?
421 421 # NOTE: RFC 2616, S4.4, #3 says we ignore this if tr_enc is "chunked"
422 422 length = res.msg.getheader('content-length')
423 423 if length and not res.chunked:
424 424 try:
425 425 res.length = int(length)
426 426 except ValueError:
427 427 res.length = None
428 428 else:
429 429 if res.length < 0: # ignore nonsensical negative lengths
430 430 res.length = None
431 431 else:
432 432 res.length = None
433 433
434 434 # does the body have a fixed length? (of zero)
435 435 if (status == httplib.NO_CONTENT or status == httplib.NOT_MODIFIED or
436 436 100 <= status < 200 or # 1xx codes
437 437 res._method == 'HEAD'):
438 438 res.length = 0
439 439
440 440 # if the connection remains open, and we aren't using chunked, and
441 441 # a content-length was not provided, then assume that the connection
442 442 # WILL close.
443 443 if (not res.will_close and
444 444 not res.chunked and
445 445 res.length is None):
446 446 res.will_close = 1
447 447
448 448 self.proxyres = res
449 449
450 450 return False
451 451
452 452 class httphandler(keepalive.HTTPHandler):
453 453 def http_open(self, req):
454 454 return self.do_open(httpconnection, req)
455 455
456 456 def _start_transaction(self, h, req):
457 457 _generic_start_transaction(self, h, req)
458 458 return keepalive.HTTPHandler._start_transaction(self, h, req)
459 459
460 460 def __del__(self):
461 461 self.close_all()
462 462
463 463 if has_https:
464 464 class BetterHTTPS(httplib.HTTPSConnection):
465 465 send = keepalive.safesend
466 466
467 467 def connect(self):
468 468 if hasattr(self, 'ui'):
469 469 cacerts = self.ui.config('web', 'cacerts')
470 470 else:
471 471 cacerts = None
472 472
473 473 if cacerts:
474 474 sock = _create_connection((self.host, self.port))
475 475 self.sock = _ssl_wrap_socket(sock, self.key_file,
476 476 self.cert_file, cert_reqs=CERT_REQUIRED,
477 477 ca_certs=cacerts)
478 478 self.ui.debug(_('server identity verification succeeded\n'))
479 479 else:
480 480 httplib.HTTPSConnection.connect(self)
481 481
482 482 class httpsconnection(BetterHTTPS):
483 483 response_class = keepalive.HTTPResponse
484 484 # must be able to send big bundle as stream.
485 485 send = _gen_sendfile(BetterHTTPS)
486 486 getresponse = keepalive.wrapgetresponse(httplib.HTTPSConnection)
487 487
488 488 def connect(self):
489 489 if self.realhost: # use CONNECT proxy
490 490 self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
491 491 self.sock.connect((self.host, self.port))
492 492 if _generic_proxytunnel(self):
493 493 self.sock = _ssl_wrap_socket(self.sock, self.cert_file,
494 494 self.key_file)
495 495 else:
496 496 BetterHTTPS.connect(self)
497 497
498 498 class httpshandler(keepalive.KeepAliveHandler, urllib2.HTTPSHandler):
499 499 def __init__(self, ui):
500 500 keepalive.KeepAliveHandler.__init__(self)
501 501 urllib2.HTTPSHandler.__init__(self)
502 502 self.ui = ui
503 503 self.pwmgr = passwordmgr(self.ui)
504 504
505 505 def _start_transaction(self, h, req):
506 506 _generic_start_transaction(self, h, req)
507 507 return keepalive.KeepAliveHandler._start_transaction(self, h, req)
508 508
509 509 def https_open(self, req):
510 510 self.auth = self.pwmgr.readauthtoken(req.get_full_url())
511 511 return self.do_open(self._makeconnection, req)
512 512
513 513 def _makeconnection(self, host, port=None, *args, **kwargs):
514 514 keyfile = None
515 515 certfile = None
516 516
517 517 if args: # key_file
518 518 keyfile = args.pop(0)
519 519 if args: # cert_file
520 520 certfile = args.pop(0)
521 521
522 522 # if the user has specified different key/cert files in
523 523 # hgrc, we prefer these
524 524 if self.auth and 'key' in self.auth and 'cert' in self.auth:
525 525 keyfile = self.auth['key']
526 526 certfile = self.auth['cert']
527 527
528 528 conn = httpsconnection(host, port, keyfile, certfile, *args, **kwargs)
529 529 conn.ui = self.ui
530 530 return conn
531 531
532 532 # In python < 2.5 AbstractDigestAuthHandler raises a ValueError if
533 533 # it doesn't know about the auth type requested. This can happen if
534 534 # somebody is using BasicAuth and types a bad password.
535 535 class httpdigestauthhandler(urllib2.HTTPDigestAuthHandler):
536 536 def http_error_auth_reqed(self, auth_header, host, req, headers):
537 537 try:
538 538 return urllib2.HTTPDigestAuthHandler.http_error_auth_reqed(
539 539 self, auth_header, host, req, headers)
540 540 except ValueError, inst:
541 541 arg = inst.args[0]
542 542 if arg.startswith("AbstractDigestAuthHandler doesn't know "):
543 543 return
544 544 raise
545 545
546 546 def getauthinfo(path):
547 547 scheme, netloc, urlpath, query, frag = urlparse.urlsplit(path)
548 548 if not urlpath:
549 549 urlpath = '/'
550 550 if scheme != 'file':
551 551 # XXX: why are we quoting the path again with some smart
552 552 # heuristic here? Anyway, it cannot be done with file://
553 553 # urls since path encoding is os/fs dependent (see
554 554 # urllib.pathname2url() for details).
555 555 urlpath = quotepath(urlpath)
556 556 host, port, user, passwd = netlocsplit(netloc)
557 557
558 558 # urllib cannot handle URLs with embedded user or passwd
559 559 url = urlparse.urlunsplit((scheme, netlocunsplit(host, port),
560 560 urlpath, query, frag))
561 561 if user:
562 562 netloc = host
563 563 if port:
564 564 netloc += ':' + port
565 565 # Python < 2.4.3 uses only the netloc to search for a password
566 566 authinfo = (None, (url, netloc), user, passwd or '')
567 567 else:
568 568 authinfo = None
569 569 return url, authinfo
570 570
571 571 handlerfuncs = []
572 572
573 573 def opener(ui, authinfo=None):
574 574 '''
575 575 construct an opener suitable for urllib2
576 576 authinfo will be added to the password manager
577 577 '''
578 578 handlers = [httphandler()]
579 579 if has_https:
580 580 handlers.append(httpshandler(ui))
581 581
582 582 handlers.append(proxyhandler(ui))
583 583
584 584 passmgr = passwordmgr(ui)
585 585 if authinfo is not None:
586 586 passmgr.add_password(*authinfo)
587 587 user, passwd = authinfo[2:4]
588 588 ui.debug('http auth: user %s, password %s\n' %
589 589 (user, passwd and '*' * len(passwd) or 'not set'))
590 590
591 591 handlers.extend((urllib2.HTTPBasicAuthHandler(passmgr),
592 592 httpdigestauthhandler(passmgr)))
593 593 handlers.extend([h(ui, passmgr) for h in handlerfuncs])
594 594 opener = urllib2.build_opener(*handlers)
595 595
596 596 # 1.0 here is the _protocol_ version
597 597 opener.addheaders = [('User-agent', 'mercurial/proto-1.0')]
598 598 opener.addheaders.append(('Accept', 'application/mercurial-0.1'))
599 599 return opener
600 600
601 601 scheme_re = re.compile(r'^([a-zA-Z0-9+-.]+)://')
602 602
603 603 def open(ui, url, data=None):
604 604 scheme = None
605 605 m = scheme_re.search(url)
606 606 if m:
607 607 scheme = m.group(1).lower()
608 608 if not scheme:
609 609 path = util.normpath(os.path.abspath(url))
610 610 url = 'file://' + urllib.pathname2url(path)
611 611 authinfo = None
612 612 else:
613 613 url, authinfo = getauthinfo(url)
614 614 return opener(ui, authinfo).open(url, data)
General Comments 0
You need to be logged in to leave comments. Login now