diff options
author | Senthil Kumaran <skumaran@gatech.edu> | 2020-01-03 18:20:43 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-03 18:20:43 -0800 |
commit | 2ddf725a53aabb254cd4c4e4857f8973e6601ece (patch) | |
tree | 07627b56c9ae53a722d73a6f831434c6df3979e8 | |
parent | 5bba60290b4ac8c95ac46cfdaba5deee37be1fab (diff) | |
download | cpython-git-revert-17774-issue27973-win-fix.tar.gz |
Revert "bpo-27973 - Use test.support.temp_dir instead of NamedTemporaryFile for the (#17774)"revert-17774-issue27973-win-fix
This reverts commit 5bba60290b4ac8c95ac46cfdaba5deee37be1fab.
-rw-r--r-- | Lib/test/test_urllibnet.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_urllibnet.py b/Lib/test/test_urllibnet.py index ef33e3a0ea..df118dc75d 100644 --- a/Lib/test/test_urllibnet.py +++ b/Lib/test/test_urllibnet.py @@ -1,3 +1,4 @@ +import tempfile import unittest from test import test_support from test.test_urllib2net import skip_ftp_test_on_travis @@ -223,10 +224,9 @@ class urlopen_FTPTest(unittest.TestCase): with test_support.transient_internet(self.FTP_TEST_FILE): try: - for file_num in range(self.NUM_FTP_RETRIEVES): - with test_support.temp_dir() as td: - urllib.FancyURLopener().retrieve(self.FTP_TEST_FILE, - os.path.join(td, str(file_num))) + for _ in range(self.NUM_FTP_RETRIEVES): + with tempfile.NamedTemporaryFile() as fp: + urllib.FancyURLopener().retrieve(self.FTP_TEST_FILE, fp.name) except IOError as e: self.fail("Failed FTP retrieve while accessing ftp url " "multiple times.\n Error message was : %s" % e) |