Even though relative redirects are illegal, they are common
urllib treated every relative redirect as though it was to http,
even if the original was https://
As long as we're compensating for server bugs, might as well do
it properly.
number of entries into http_error_302 exceeds the value set for the maxtries
attribute (which defaults to 10), the recursion is exited by calling
the http_error_500 method (or if that is not defined, http_error_default).
when quoting forbidden characters. There are scripts out there that
break with lower case, therefore I guess %%%X should be used."
I agree, so am fixing this.
obsolete!).
Fix a bug in ftpwrapper.retrfile() where somehow ftplib.error_perm was
assumed to be a string. (The fix applies str().)
Also break some long lines and change the output from test() slightly.
invalid proxy setting.
Minor change to call of unknown_url; always pass data argument
explicitly since data defaults to None.
PEP 42: Add as a feature that urllib handle proxy setting that contain
only the host and port of the proxy.
The earlier code assumed "protocol=host;protocol=host;..." or "host",
but Windows may also use "protocol=host" (just one entry), as well as
"protocol://host". This code needs some more work, so I'll leave the
bug open for now.
character according to RFC 2396. Add some text to quote doc string
that explains the quoting rules better.
This closes SF Bug #114427.
Add _fast_quote operation that uses a dictionary instead of a list
when the standard set of safe characters is used.
so that a subclass can override it.
This partly addresses Bug #112634 -- but the documentation is still
wrong, since it suggests that you can set self.version *after* calling
the base class __init__. In fact it must be done *before*.
I'll fix that too.
Patch description
-----------------
This addresses four issues:
(1) usernames and passwords in urls with special characters are now
decoded properly. i.e. http://foo%2C:bar@www.whatever.com/
(2) Basic Auth support has been added to HTTPS, like it was in HTTP.
(3) Version 1.92 sent the POSTed data, but did not deal with errors
(HTTP responses other than 200) properly. HTTPS now behaves the
same way HTTP does.
(4) made URL-checking beahve the same way with HTTPS as it does with
HTTP (changed == to !=).
Note that this patch looks worse than it is - an existing function (getproxies() for all platforms other than Win/Mac) has been moved, renamed and indentation changed, but the body of that function is identical. Windows now allows the environment variables to override the registry.
comments, docstrings or error messages. I fixed two minor things in
test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't").
There is a minor style issue involved: Guido seems to have preferred English
grammar (behaviour, honour) in a couple places. This patch changes that to
American, which is the more prominent style in the source. I prefer English
myself, so if English is preferred, I'd be happy to supply a patch myself ;)
often, ftp URLs hang in the final close. Further analysis suggests
that this is because the close hook in addclosehook() calls the hook
before acually closing the connection. The hook, in this case, waits
for the '226 Transfer complete' status from the server on the command
socket. However, more and more ftp servers only send this status when
the data socket has actually been closed -- causing a deadlock.
The fix is simple: in addclosehook.close(), call addbase.close()
*before* calling the closehook.
The attached patches update the standard library so that all modules
have docstrings beginning with one-line summaries.
A new docstring was added to formatter. The docstring for os.py
was updated to mention nt, os2, ce in addition to posix, dos, mac.
Fixed a TypeError: not enough arguments; expected 4, got 3.
When authentication is needed, the default http_error_401 method calls
retry_http_basic_auth. The default version of that method expected a
data argument which wasn't provided, so now we provide the argument if
it was given and we also made the data argument optional.
Also changed other calls where data was optional to not pass data if
it was not passed to the calling method (in line with other similar
occurances).
Brian E Gallew, which were improved and adapted to OpenSSL 0.9.4 by
Laszlo Kovacs of HP. Both have kindly given permission to include
the patches in the Python distribution. Final formatting by GvR.
In splithost, accept empty host part in URLs. This is required for
file URLs that can have an empty host part. For such URLs, we should
not return the initial 2 slashes as part of the file name.
Urllib makes the URL of the opened file available through the geturl
method of the returned object. For local files, this consists of
file: plus the name of the file. This results in an invalid URL if
the file name was relative. This patch fixes this so that the
returned URL is just a relative URL in that case. When the file name
is absolute, the URL returned is of the form file:///absolute/path.
[I guess that a URL of the form "file:foo.html" is illegal... GvR]