Repository navigation
ltfs_ordered_copy: accept str values from xattr.get() (#522) - #660
Closed
MitchelTighe wants to merge 1 commit into
Closed
MitchelTighe wants to merge 1 commit into
MitchelTighe wants to merge 1 commit into
Conversation
The destination check calls sig.startswith(b"LTFS") on the value returned
by xattr.get(). Depending on the xattr module in use, that value can be
str rather than bytes, and the check then fails with
Check destination:startswith first arg must be str, not bytes
before anything is copied. This is the mirror image of the error
reported in LinearTapeFileSystem#522. Encode a str value before comparing.
Related to LinearTapeFileSystem#522
MitchelTighe
force-pushed
the
fix/ordered-copy-launch-522
branch
from
October 16, 2026 00:35
4de3dfb to
591f90a
Compare
Author
|
Closing this one myself. The error reported in #522 no longer reproduces on current main, and pyxattr's xattr.get() returns bytes, so the str case this guarded against is hypothetical. Sorry for the noise. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #522
The destination check calls
sig.startswith(b"LTFS")on the value returned byxattr.get(). Depending on the xattr module in use, that value can bestrrather thanbytes, and the check then fails with:That's the mirror image of the error reported in #522. This PR encodes a
strvalue before the comparison. It's a 2-line change.Why "related" rather than "fixes": the exact error in #522 (
must be bytes ... not str) no longer reproduces on currentmain, because the check already compares againstb"LTFS". This PR covers the remainingstrcase.Update: an earlier version of this PR also changed the shebang to
python3. I dropped that after reading #424/#425, which explain why the genericpythonshebang is kept and that packagers adjust it per distro.Testing (local harness with an xattr shim that returns
str, no real tape):Written with help from an AI assistant (Claude).