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

Make safe filename safe to use on POSIX #44

Merged
merged 4 commits into from
Aug 24, 2022
Merged

Conversation

pombredanne
Copy link
Member

This enables handling safe paths treating some extra characters as safe on POSIX.
In particular this ensures that we can treat the colon ":" as safe for use in file names
on POSIX only. This will allow correct processing of system files in ScanCode.io
and ExtractCode

Reference: aboutcode-org/extractcode#41
Reference: aboutcode-org/scancode.io#407
Reference: aboutcode-org/scancode.io#445

@pombredanne
Copy link
Member Author

@JonoYang Do you mind to add a few tests so that we can merge this?

    * Test posix_only argument for safe_path
    * Update CHANGELOG.rst

Signed-off-by: Jono Yang <[email protected]>
@JonoYang
Copy link
Member

JonoYang commented Aug 3, 2022

@pombredanne I've added some test code that checks to see if portable_filename preserves or replaces the valid POSIX path characters.

Copy link
Member Author

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

LGTM!
Merging.

@pombredanne pombredanne merged commit c31bc0e into main Aug 24, 2022
@pombredanne pombredanne deleted the posix-safe-filename branch August 24, 2022 15:50
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