File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -3827,13 +3827,19 @@ def test_realpath_limit_attack(self):
38273827 # we can also create new files as well!
38283828 arc .add ("escape/newfile" , content = 'new' )
38293829
3830- with self .check_context (arc .open (), filter = 'fully_trusted' ,
3831- check_flag = False ):
3830+ with (self .subTest ('fully_trusted' ),
3831+ self .check_context (arc .open (), filter = 'fully_trusted' ,
3832+ check_flag = False )):
38323833 if sys .platform == 'win32' :
38333834 self .expect_exception ((FileNotFoundError , FileExistsError ))
38343835 elif self .raised_exception :
38353836 # Most likely, guess for number of components was wrong?
3836- self .expect_exception (KeyError )
3837+ try :
3838+ raise self .raised_exception
3839+ except KeyError :
3840+ pass
3841+ except OSError as exc :
3842+ self .assertEqual (exc .errno , errno .ENAMETOOLONG )
38373843 elif os_helper .can_symlink () and os_helper .can_hardlink ():
38383844 self .expect_any_tree (component )
38393845 self .expect_file ('flaglink' , content = 'overwrite' )
You can’t perform that action at this time.
0 commit comments