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

2021-09-21 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Pyth

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

2019-07-02 Thread STINNER Victor
STINNER Victor 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):"

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

2019-07-02 Thread STINNER Victor
STINNER Victor added the comment: > urlcleanup also sets the global variable _opener to None so it does the extra > work of uninstalling the global variable opener set by install_opener which > is also not documented. Oh wait, urlopen() also sets this private _opener global variable and so h

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

2019-07-01 Thread Senthil Kumaran
Senthil Kumaran added the comment: Hi Victor and Karthikeyan, Both your analysis are correct. - This is a legacy interface, present purely for satisfying the old code, when urlretrieve was advertised as the first/easy to way to use urllib and download something. - At this moment, I think,

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

2019-07-01 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I have added Senthil for thoughts. The temporary files is also stored in a module level variable. Looking into the git history there were some changes in e24f96a05973ddbb59d88c03570aef8545c5ef10 . The function is also marked as legacy in __all__ wi

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

2019-07-01 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +orsenthil ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

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

2019-07-01 Thread STINNER Victor
New submission from STINNER Victor : While working on bpo-37421 "Some tests leak temporary files", I had to write PR 14529 fix: test_urllib urlretrieve() tests now explicitly call urlcleanup() to remove temporary files. If urlretrieve() caller forgets to remove the temporary file, the "tempor