File tree 1 file changed +3
-3
lines changed 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -1684,14 +1684,14 @@ def test_missing_fileobj(self):
1684
1684
@unittest .mock .patch ('os.chmod' )
1685
1685
def test_deferred_directory_attributes_update (self , mock_chmod ):
1686
1686
# Regression test for gh-127987: setting attributes on arbitrary files
1687
- tempdir = os .path .join (TEMPDIR , 'test127987' )
1687
+ tempdir = os .path .realpath ( os . path . join (TEMPDIR , 'test127987' ) )
1688
1688
def mock_chmod_side_effect (path , mode , ** kwargs ):
1689
1689
target_path = os .path .realpath (path )
1690
1690
if os .path .commonpath ([target_path , tempdir ]) != tempdir :
1691
- raise Exception ("should not try to chmod anything outside the destination" , target_path )
1691
+ raise Exception (f"tried to chmod { path !r } ( { target_path !r } ) which is outside the tree ( { tempdir !r } )" )
1692
1692
mock_chmod .side_effect = mock_chmod_side_effect
1693
1693
1694
- outside_tree_dir = os .path .join (TEMPDIR , 'outside_tree_dir' )
1694
+ outside_tree_dir = os .path .realpath ( os . path . join (TEMPDIR , 'outside_tree_dir' ) )
1695
1695
with ArchiveMaker () as arc :
1696
1696
arc .add ('x' , symlink_to = '.' )
1697
1697
arc .add ('x' , type = tarfile .DIRTYPE , mode = '?rwsrwsrwt' )
You can’t perform that action at this time.
0 commit comments