* Deprecate urllib.urlopen() in favor of urllib2.urlopen() for 3.0.
* Update docs to mention split/rename of the module and deprecation of
urlopen().
Changes to lib2to3 are in a separate commit. Work is for issue #2885.
all the upper level libraries that use it, including urllib2.
Added and fixed some tests, and changed docs correspondingly.
Thanks to John J Lee for the patch and the pusing, :)
getproxies_macosx_sysconf uses ctypes to call SystemConfiguration APIs. This
checkin adds ctypes annotation to specify the right argument types for the
API's that are used.
This is needed to be able to use urllib on a 64-bit system, without
annotations you'd get a hard crash.
This patch removes the dependency on the Carbon package from urllib.
The mac-specific code for getting proxy configuration is now writting in
Python using ctypes and uses the SystemConfiguration framework instead of
InternetConfig. Also provides a mac-specific implementation of proxy_bypass.
r58207 and r58247 patch logic is reversed. I noticed this when I
tried to use urllib to retrieve a file which required auth.
Fix that and add a test for 401 error to verify.
1) Improve the documentation of the SSL module, with a fuller
explanation of certificate usage, another reference, proper
formatting of this and that.
2) Fix Windows bug in ssl.py, and general bug in sslsocket.close().
Remove some unused code from ssl.py. Allow accept() to be called on
sslsocket sockets.
3) Use try-except-else in import of ssl in socket.py. Deprecate use of
socket.ssl().
4) Remove use of socket.ssl() in every library module, except for
test_socket_ssl.py and test_ssl.py.
Python 2.5.
Also remove gopher support from urllib/urllib2. As both imported gopherlib the
usage of the support would have raised a DeprecationWarning.
I'm guessing that's the problem. h.getfile() must be called *after*
h.getreply() and the fp can be None.
I'm not entirely convinced this is the best fix (or even correct).
The buildbots will tell us if things improve or not. I don't
know if this needs to be backported (assuming it actually works).
Test suites for urllib and urlparse run with each other's function to verify
correctness of replacement and both test suites pass.
Bumped urllib's __version__ attribute up a minor number.
- When redirecting, always use GET. This is common practice and
more-or-less sanctioned by the HTTP standard.
- Add a handler for 307 redirection, which becomes an error for POST,
but a regular redirect for GET and HEAD.