Unable to extract files by --path in certain locales/charmaps #1283
Labels
No labels
blocked
breaking
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
borgmatic-collective/borgmatic#1283
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
After backing up a file who's filename contains invalid UTF-8 byte sequences, I can't extract it by
--pathwhile in a non UTF-8 locale.Steps to reproduce
/tmp/scratch$ LC_CTYPE=de_AT.utf8
/tmp/scratch$ cat > config.yaml <<EOF
source_directories:
- /tmp/scratch/source
repositories:
- path: /tmp/scratch/repo
keep_within: 1H
EOF
/tmp/scratch$ mkdir source
/tmp/scratch$ touch source/$'\326'sterreich
/tmp/scratch$ borgmatic -c config.yaml repo-create -e none
/tmp/scratch$ borgmatic -c config.yaml
/tmp/scratch$ mkdir dest
/tmp/scratch$ borgmatic -c config.yaml extract --archive latest --destination dest --strip-components 3 --path tmp/scratch/source/$'\326'sterreich
/tmp/scratch$ ls dest/
''$'\326''sterreich'
/tmp/scratch$ LC_CTYPE=de_AT.iso8859-1 borgmatic -c config.yaml extract --archive latest --destination dest --strip-components 3 --path tmp/scratch/source/$'\326'sterreich
Include pattern 'tmp/scratch/source/�sterreich' never matched.
Treating exit code 101 as an error, as per borgmatic defaults
/tmp/scratch/repo: Error running actions for repository
/tmp/scratch/repo: Command 'borg extract --log-json --strip-components 3 /tmp/scratch/repo::pvsvie01a2-2026-03-09T23:42:31.104211 tmp/scratch/source/�sterreich' returned non-zero exit status 101.
/tmp/scratch/config.yaml: Error running configuration
/tmp/scratch/config.yaml: An error occurred
summary:
An error occurred
Error running actions for repository
Include pattern 'tmp/scratch/source/�sterreich' never matched.
Command 'borg extract --log-json --strip-components 3 /tmp/scratch/repo::pvsvie01a2-2026-03-09T23:42:31.104211 tmp/scratch/source/�sterreich' returned non-zero exit status 101.
Error running configuration
Need some help? https://torsion.org/borgmatic/#issues
Actual behavior
No response
Expected behavior
Extract the file, don't use the replacement character for "invalid" bytes.
Other notes / implementation ideas
No response
borgmatic version
2.1.3
borgmatic installation method
No response
Borg version
borg 1.4.3
Python version
Python 3.14.3
Database version (if applicable)
No response
Operating system and version
Linux / ext4 filesystem
Thanks for filing this one. However it looks like another potential Borg limitation: