[issue37475] What is urllib.request.urlcleanup() function?

STINNER Victor report at bugs.python.org
Tue Jul 2 08:53:14 EDT 2019


STINNER Victor <vstinner at redhat.com> added the comment:

Another weirdness of test_urllib.py: it redefines urlopen() and actually tests its test function, rather than testing the urllib.request module.

https://github.com/python/cpython/pull/14529#issuecomment-507646868

"def urlopen(url, data=None, proxies=None):" in test_urllib.py is as old as the urllib module itself!

commit 1afc1696167547a5fa101c53e5a3ab4717f8852c
Author: Jeremy Hylton <jeremy at alum.mit.edu>
Date:   Wed Jun 18 20:49:58 2008 +0000

    Make a new urllib package .
    
    It consists of code from urllib, urllib2, urlparse, and robotparser.
    The old modules have all been removed.  The new package has five
    submodules: urllib.parse, urllib.request, urllib.response,
    urllib.error, and urllib.robotparser.  The urllib.request.urlopen()
    function uses the url opener from urllib2.
    
    Note that the unittests have not been renamed for the
    beta, but they will be renamed in the future.
    
    Joint work with Senthil Kumaran.

At least, the test function should have a different name, no?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37475>
_______________________________________


More information about the Python-bugs-list mailing list