Lines Matching +full:macosx +full:- +full:version +full:- +full:min
5 below). It opens the URL and returns the results as file-like
13 non-error returns. The HTTPRedirectHandler automatically deals with
17 urlopen(url, data=None) -- Basic usage is the same as original
19 get a file-like object back. One difference is that you can also pass
24 build_opener -- Function that creates a new OpenerDirector instance.
30 install_opener -- Installs a new opener as the default opener.
34 OpenerDirector -- Sets up the User Agent as the Python-urllib client and manages
37 Request -- An object that encapsulates the state of a request. The
39 headers, e.g. a User-Agent.
41 BaseHandler --
54 uri='https://mahler:8092/site-updates.py',
58 proxy_support = urllib.request.ProxyHandler({"http" : "http://ahad-haam:3128"})
78 # check digest against correct (i.e. non-apache) implementation
135 # used in User-Agent header sent
173 msg attribute contains the same information as the reason attribute ---
174 the reason phrase returned by the server --- instead of the response
258 size = -1
261 if "content-length" in headers:
262 size = int(headers["Content-Length"])
300 """Return request-host, as defined by RFC 2965.
343 # unwrap('<URL:type://host/path>') --> 'type://host/path'
363 # if we change data we need to remove content-length header
365 if self.has_header("Content-length"):
366 self.remove_header("Content-length")
426 client_version = "Python-urllib/%s" % __version__
427 self.addheaders = [('User-agent', client_version)]
510 # pre-process request
519 # post-process response
544 # XXX http[s] protocols are special-cased
657 perform the redirect. Otherwise, raise HTTPError if no-one
677 CONTENT_HEADERS = ("content-length", "content-type")
687 # have already seen. Do this by adding a handler-specific
708 "%s - Redirection to url '%s' is not allowed" % (msg, newurl),
716 # http.client.parse_headers() decodes as ISO-8859-1. Recover the
717 # original bytes and percent-encode non-ASCII bytes, and any special
720 newurl, encoding="iso-8859-1", safe=string.punctuation)
725 # handlers that also use handler-specific request attributes
772 # We have an authority, so for RFC 3986-compliant URLs (by ss 3.
779 if end == -1:
817 req.add_header('Proxy-authorization', 'Basic ' + creds)
939 # XXX this allows for multiple auth-schemes, but will stupidly pick
942 # allow for double- and single-quoted realm values
954 # XXX could pre-emptively send auth info already accepted (RFC 2617,
965 # parse WWW-Authenticate header: accept multiple challenges per header
1054 response = self.http_error_auth_reqed('www-authenticate',
1061 auth_header = 'Proxy-authorization'
1069 response = self.http_error_auth_reqed('proxy-authenticate',
1081 # XXX The client does not inspect the Authentication-Info header
1087 # XXX qop="auth-int" supports is shaky
1104 # Don't fail endlessly - if we failed once, we'll probably
1134 # The cnonce-value is an opaque
1174 … # NOTE: As per RFC 2617, when server sends "auth,auth-int", the client could use either `auth`
1175 # or `auth-int` to the response back. we use `auth` to send the response back.
1189 # XXX handle auth-int.
1212 # XXX MD5-sess
1236 retry = self.http_error_auth_reqed('www-authenticate',
1244 auth_header = 'Proxy-Authorization'
1249 retry = self.http_error_auth_reqed('proxy-authenticate',
1278 if not request.has_header('Content-type'):
1280 'Content-type',
1281 'application/x-www-form-urlencoded')
1282 if (not request.has_header('Content-length')
1283 and not request.has_header('Transfer-encoding')):
1287 'Content-length', str(content_length))
1290 'Transfer-encoding', 'chunked')
1336 proxy_auth_hdr = "Proxy-Authorization"
1339 # Proxy-Authorization should not be sent to origin
1347 encode_chunked=req.has_header('Transfer-encoding'))
1424 if v[0] == '"' and v[-1] == '"':
1425 v = v[1:-1]
1432 In particular, parse comma-separated lists where the elements of
1433 the list may include quoted-strings. A quoted-string could
1434 contain a comma. A non-quoted string could have quotes in the
1436 Only double-quotes count, not single-quotes.
1508 'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' %
1559 dirs, file = dirs[:-1], dirs[-1]
1574 headers += "Content-type: %s\n" % mtype
1576 headers += "Content-length: %d\n" % retrlen
1623 self.soonest = min(list(self.timeout.values()))
1632 self.soonest = min(list(self.timeout.values()))
1660 mediatype = mediatype[:-7]
1663 mediatype = "text/plain;charset=US-ASCII"
1665 headers = email.message_from_string("Content-type: %s\nContent-length: %d\n" %
1675 # Helper for non-unix systems
1680 """OS-specific conversion from a relative URL of the 'file' scheme
1685 """OS-specific conversion from a file system path to a relative URL
1696 more than one set of global protocol-specific options.
1697 Note -- this is a base class for those who don't want the
1703 version = "Python-urllib/%s" % __version__ variable in URLopener
1716 self.addheaders = [('User-Agent', self.version), ('Accept', '*/*')]
1778 name = name.replace('-', '_')
1839 size = -1
1842 if "content-length" in headers:
1843 size = int(headers["Content-Length"])
1860 # raise exception if actual size does not match content-length header
1877 - connection_factory should take a host name and return an
1879 - url is the url to retrieval or a host, relative-path pair.
1880 - data is payload for a POST request or None.
1926 headers["Proxy-Authorization"] = "Basic %s" % proxy_auth
1941 headers["Content-Type"] = "application/x-www-form-urlencoded"
1970 named http_error_DDD where DDD is the 3-digit error code."""
2020 'Content-Type: %s\nContent-Length: %d\nLast-modified: %s\n' %
2061 dirs, file = dirs[:-1], dirs[-1]
2088 headers += "Content-Type: %s\n" % mtype
2090 headers += "Content-Length: %d\n" % retrlen
2112 type = 'text/plain;charset=US-ASCII'
2122 msg.append('Content-type: %s' % type)
2125 data = base64.decodebytes(data.encode('ascii')).decode('latin-1')
2128 msg.append('Content-Length: %d' % len(data))
2148 """Default error handling -- don't raise an exception."""
2152 """Error 302 -- relocated (temporarily)."""
2198 """Error 301 -- also relocated (permanently)."""
2202 """Error 303 -- also relocated (essentially identical to 302)."""
2206 """Error 307 -- relocated, but turn POST into error."""
2214 """Error 401 -- authentication required.
2216 if 'www-authenticate' not in headers:
2219 stuff = headers['www-authenticate']
2239 """Error 407 -- proxy authentication required.
2241 if 'proxy-authenticate' not in headers:
2244 stuff = headers['proxy-authenticate']
2474 self.refcount -= 1
2487 """Return a dictionary of scheme -> proxy server URL mappings.
2500 if value and name[-6:] == '_proxy':
2501 proxies[name[:-6]] = value
2502 # CVE-2016-1000110 - If we are running as CGI script, forget HTTP_PROXY
2503 # (non-all-lowercase) as it may be set from the web server by a "Proxy:"
2509 if name[-6:] == '_proxy':
2512 proxies[name[:-6]] = value
2514 proxies.pop(name[:-6], None)
2558 This function uses the MacOSX framework SystemConfiguration
2608 mask = 32 - mask
2627 """Return a dictionary of scheme -> proxy server URL mappings.
2629 This function uses the MacOSX framework SystemConfiguration
2640 or from the MacOSX framework SystemConfiguration.
2655 """Return a dictionary of scheme -> proxy server URL mappings.
2664 # Std module, so should be around - but you never know!
2676 # Per-protocol settings
2700 """Return a dictionary of scheme -> proxy server URL mappings.
2712 # Std modules, so should be around - but you never know!