| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Add *preserve_metadata* keyword-only argument to `pathlib.Path.copy()`, defaulting to false. When set to true, we copy timestamps, permissions, extended attributes and flags where available, like `shutil.copystat()`. The argument has no effect on Windows, where metadata is always copied. In the pathlib ABCs we copy the file permissions with `PathBase.chmod()` where supported. In the future we might want to support a more generic public interface for copying metadata between different types of `PathBase` object, but it would be premature here.
⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️Hi! The buildbot PPC64LE Fedora Stable Clang Installed 3.x has failed when building commit 88fc065. What do you need to do:
You can take a look at the buildbot page here: https://buildbot.python.org/all/#builders/451/builds/4646 Failed tests:
Failed subtests:
Summary of the results of the build (if available): == Click to see traceback logsTraceback (most recent call last):
File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le.clang-installed/build/target/lib/python3.14/test/test_pathlib/test_pathlib.py", line 660, in test_copy_file_preserve_metadata
os.setxattr(source, b'user.foo', b'42')
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 95] Operation not supported: '/tmp/test_python_pfjupu1y/test_python_2060648æ/@test_2060648_tmpæ/fileA'
Traceback (most recent call last):
File "/home/buildbot/buildarea/3.x.cstratak-fedora-stable-ppc64le.clang-installed/build/target/lib/python3.14/test/test_pathlib/test_pathlib.py", line 660, in test_copy_file_preserve_metadata
os.setxattr(source, b'user.foo', b'42')
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 95] Operation not supported: '/tmp/test_python__riczf75/test_python_2046711æ/@test_2046711_tmpæ/fileA'
|
Sorry, something went wrong.
Follow-up to python#120806. Use `os_helper.skip_unless_xattr` to skip testing xattr preservation when unsupported.
…ython#120806) Add *preserve_metadata* keyword-only argument to `pathlib.Path.copy()`, defaulting to false. When set to true, we copy timestamps, permissions, extended attributes and flags where available, like `shutil.copystat()`. The argument has no effect on Windows, where metadata is always copied. Internally (in the pathlib ABCs), path types gain `_readable_metadata` and `_writable_metadata` attributes. These sets of strings describe what kinds of metadata can be retrieved and stored. We take an intersection of `source._readable_metadata` and `target._writable_metadata` to minimise reads/writes. A new `_read_metadata()` method accepts a set of metadata keys and returns a dict with those keys, and a new `_write_metadata()` method accepts a dict of metadata. We *might* make these public in future, but it's hard to justify while the ABCs are still private.
…thon#121444) Follow-up to python#120806. Use `os_helper.skip_unless_xattr` to skip testing xattr preservation when unsupported.
…ython#120806) Add *preserve_metadata* keyword-only argument to `pathlib.Path.copy()`, defaulting to false. When set to true, we copy timestamps, permissions, extended attributes and flags where available, like `shutil.copystat()`. The argument has no effect on Windows, where metadata is always copied. Internally (in the pathlib ABCs), path types gain `_readable_metadata` and `_writable_metadata` attributes. These sets of strings describe what kinds of metadata can be retrieved and stored. We take an intersection of `source._readable_metadata` and `target._writable_metadata` to minimise reads/writes. A new `_read_metadata()` method accepts a set of metadata keys and returns a dict with those keys, and a new `_write_metadata()` method accepts a dict of metadata. We *might* make these public in future, but it's hard to justify while the ABCs are still private.
…thon#121444) Follow-up to python#120806. Use `os_helper.skip_unless_xattr` to skip testing xattr preservation when unsupported.
| Back | FazBrowse Home | New Git URL |
Add preserve_metadata keyword-only argument to pathlib.Path.copy(), defaulting to false. When set to true, we copy timestamps, permissions, extended attributes and flags where available, like shutil.copystat(). The argument has no effect on Windows, where metadata is always copied.
Internally (in the pathlib ABCs), path types gain _readable_metadata and _writable_metadata attributes. These sets of strings describe what kinds of metadata can be retrieved and stored. We take an intersection of source._readable_metadata and target._writable_metadata to minimise reads/writes. A new _read_metadata() method accepts a set of metadata keys and returns a dict with those keys, and a new _write_metadata() method accepts a dict of metadata. We might make these public in future, but it's hard to justify while the ABCs are still private.
📚 Documentation preview 📚: https://cpython-previews--120806.org.readthedocs.build/