From: Michael Foord Date: Tue, 4 May 2010 22:29:10 +0000 (+0000) Subject: Fix error handling removing files in test.support.unlink X-Git-Tag: v3.2a1~933 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2d9c2d5ecd6d28a8d07fcef3f9e6c68dcb6e4faf;p=python Fix error handling removing files in test.support.unlink --- diff --git a/Lib/test/support.py b/Lib/test/support.py index 4ea6c055a7..08105df426 100644 --- a/Lib/test/support.py +++ b/Lib/test/support.py @@ -186,7 +186,7 @@ def unlink(filename): os.unlink(filename) except OSError as error: # The filename need not exist. - if error.errno != errno.ENOENT: + if error.errno not in (errno.ENOENT, errno.ENOTDIR): raise def rmtree(path): @@ -376,6 +376,7 @@ else: # module name. TESTFN = "{}_{}_tmp".format(TESTFN, os.getpid()) + # Assuming sys.getfilesystemencoding()!=sys.getdefaultencoding() # TESTFN_UNICODE is a filename that can be encoded using the # file system encoding, but *not* with the default (ascii) encoding