diff options
| author | Larry Hastings <larry@hastings.org> | 2012-07-15 00:55:11 (GMT) |
|---|---|---|
| committer | Larry Hastings <larry@hastings.org> | 2012-07-15 00:55:11 (GMT) |
| commit | ad5ae0456e64036d1f39a15c214c2f394a8fb9c3 (patch) | |
| tree | 379c65057bb04c36b9509b44d0a5c9db68758827 /Lib/test | |
| parent | 7c6309c6afebecd9cefe7c547b87cf23abcbe2a3 (diff) | |
| download | cpython-ad5ae0456e64036d1f39a15c214c2f394a8fb9c3.zip cpython-ad5ae0456e64036d1f39a15c214c2f394a8fb9c3.tar.gz cpython-ad5ae0456e64036d1f39a15c214c2f394a8fb9c3.tar.bz2 | |
- Issue #15238: shutil.copystat now copies Linux "extended attributes".
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/test_shutil.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index a2b6e88..cbbc36f 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -410,6 +410,16 @@ class TestShutil(unittest.TestCase): finally: os.setxattr = orig_setxattr + # test that shutil.copystat copies xattrs + src = os.path.join(tmp_dir, 'the_original') + write_file(src, src) + os.setxattr(src, 'user.the_value', b'fiddly') + dst = os.path.join(tmp_dir, 'the_copy') + write_file(dst, dst) + shutil.copystat(src, dst) + self.assertEqual(os.listxattr(src), ['user.the_value']) + self.assertEqual(os.getxattr(src, 'user.the_value'), b'fiddly') + @support.skip_unless_symlink @support.skip_unless_xattr @unittest.skipUnless(hasattr(os, 'geteuid') and os.geteuid() == 0, |
