Skip to content

fix: keep sanitized project paths inside the workspace - #789

Open
pcbeingused333 wants to merge 2 commits into
QuantConnect:masterfrom
pcbeingused333:fix/empty-sanitized-path-component
Open

pcbeingused333 wants to merge 2 commits into
QuantConnect:masterfrom
pcbeingused333:fix/empty-sanitized-path-component

Conversation

@pcbeingused333

@pcbeingused333 pcbeingused333 commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #776

Windows filename sanitization can remove every character from a cloud path component. An empty component at the start can turn a project path into an absolute path. A name with no components can make the local project lookup inspect the workspace root's configuration.

Use _ for components that sanitize to an empty string. Ignore leading, trailing, and repeated separators when they separate named directories. When the cloud name is empty or consists entirely of separators, use _ as the local directory name and let the existing collision handling pick a suffix if needed.

The two new regression cases failed on the previous PR head and passed with the fix, alongside the six existing path cases. The utility, cloud component, and cloud command suites passed with 523 tests and 44 skips.

This change was prepared with AI assistance.

pcbeingused333 and others added 2 commits November 26, 2026 23:55
A path component made only of forbidden characters, spaces or periods sanitized to an empty string. As the first component that made the local path absolute, so cloud push failed with ValueError. Name such components "_" and skip empty components between separators.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@pcbeingused333

Copy link
Copy Markdown
Contributor Author

The follow-up covers an empty cloud project name and one made entirely of separators. Both now use _ as the local directory name, so the lookup starts inside the workspace. The two cases failed on the previous PR head and now pass alongside the six existing path cases. Could you review the updated sanitization?

This comment was drafted with Claude Code.

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.

An empty sanitized parent component gives cloud push a destination outside the workspace

1 participant