File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4343)
4444
4545def _ignore_error (exception ):
46- return (getattr (exception , 'errno' , None ) in _IGNORED_ERROS or
46+ # XXX RUSTPYTHON: added check for FileNotFoundError, file.exists() on windows throws it
47+ # but with a errno==ESRCH for some reason
48+ return (isinstance (exception , FileNotFoundError ) or
49+ getattr (exception , 'errno' , None ) in _IGNORED_ERROS or
4750 getattr (exception , 'winerror' , None ) in _IGNORED_WINERRORS )
4851
4952
Original file line number Diff line number Diff line change @@ -1066,12 +1066,15 @@ def temp_dir(path=None, quiet=False):
10661066 try :
10671067 rmtree (path )
10681068 except OSError as exc :
1069- # XXX RUSTPYTHON: added quiet check here, not sure why rmtree fails on windows
1070- if not quiet :
1071- raise
1072- warnings .warn (f'unable to remove temporary'
1073- f'directory { path !r} : { exc } ' ,
1074- RuntimeWarning , stacklevel = 3 )
1069+ # XXX RUSTPYTHON: something something async file removal?
1070+ # also part of the thing with rmtree()
1071+ # throwing PermissionError, I think
1072+ if os .path .exists (path ):
1073+ if not quiet :
1074+ raise
1075+ warnings .warn (f'unable to remove temporary'
1076+ f'directory { path !r} : { exc } ' ,
1077+ RuntimeWarning , stacklevel = 3 )
10751078
10761079@contextlib .contextmanager
10771080def change_cwd (path , quiet = False ):
Original file line number Diff line number Diff line change @@ -88,6 +88,8 @@ def test_module_not_found(self):
8888
8989@unittest .skipUnless (sys .platform .startswith ('win' ), 'requires Windows' )
9090class WindowsExtensionSuffixTests :
91+ # TODO: RUSTPYTHON
92+ @unittest .expectedFailure
9193 def test_tagged_suffix (self ):
9294 suffixes = self .machinery .EXTENSION_SUFFIXES
9395 expected_tag = ".cp{0.major}{0.minor}-{1}.pyd" .format (sys .version_info ,
You can’t perform that action at this time.
0 commit comments