Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip and report invalid filenames when syncing #366

Merged
merged 12 commits into from
May 8, 2024

Conversation

adal-chiriliuc-reef
Copy link

Report invalid filenames when syncing and skip them, instead of crashing.

b2sdk/_internal/utils/__init__.py Outdated Show resolved Hide resolved
b2sdk/_internal/scan/folder.py Outdated Show resolved Hide resolved
@mjurbanski-reef
Copy link

please add unit test

Copy link

@mjurbanski-reef mjurbanski-reef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a test case for invalid subfolder name which contains a valid filenames

b2sdk/_internal/scan/folder.py Outdated Show resolved Hide resolved

assert reporter.has_warnings_or_errors()
assert len(reporter.warnings) == 2
assert "has an invalid filename (file names must not contain '\\'). Skipping" in reporter.warnings[

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please assert that not only explanation what is wrong to the user, but also filename with path is shown to them so they can go to the exact file and fix it

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@mjurbanski-reef mjurbanski-reef force-pushed the invalid-unicode branch 3 times, most recently from b7f0a36 to 0774eb0 Compare May 8, 2024 13:50
@mjurbanski-reef mjurbanski-reef merged commit ef702a5 into master May 8, 2024
23 of 24 checks passed
@mjurbanski-reef mjurbanski-reef deleted the invalid-unicode branch May 8, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants