Skip to content

Make safe filename safe to use on POSIX - #44

Merged
pombredanne merged 4 commits into
mainfrom
posix-safe-filename
Aug 24, 2022
Merged

Make safe filename safe to use on POSIX#44
pombredanne merged 4 commits into
mainfrom
posix-safe-filename

Conversation

@pombredanne

Copy link
Copy Markdown
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
Copy Markdown
Member Author

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

Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
Signed-off-by: Jono Yang <jyang@nexb.com>
@JonoYang
JonoYang force-pushed the posix-safe-filename branch from 58acb67 to 6434fdf Compare August 2, 2022 22:14
    * Test posix_only argument for safe_path
    * Update CHANGELOG.rst

Signed-off-by: Jono Yang <jyang@nexb.com>
@JonoYang
JonoYang force-pushed the posix-safe-filename branch from b9f0457 to b88d65a Compare August 2, 2022 23:37
@JonoYang

JonoYang commented Aug 3, 2022

Copy link
Copy Markdown
Member

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

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member Author

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