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

fix: report canonicalized module path #560

Merged
merged 1 commit into from
Jul 8, 2024
Merged

fix: report canonicalized module path #560

merged 1 commit into from
Jul 8, 2024

Conversation

bajtos
Copy link
Member

@bajtos bajtos commented Jul 8, 2024

In 31c0292 (#557), I improved the error message printed when the module is outside of the root dir to include the file path of the imported module. That's not enough to troubleshoot the problem, because we print the non-canonical path, which is potentially different from the string we use to check if the module path is within the root dir.

In this commit, I refactored the method to make the code easier to follow, and improved the error message to print the canonicalized paths of the module and the root dir.

Links:

In 31c0292 (#557), I improved the error message printed when the
module is outside of the root dir to include the file path of the
imported module. That's not enough to troubleshoot the problem,
because we print the non-canonical path, which is potentially different
from the string we use to check if the module path is within the root
dir.

In this commit, I refactored the method to make the code easier to
follow, and improved the error message to print the canonicalized
paths of the module and the root dir.

Signed-off-by: Miroslav Bajtoš <oss@bajtos.net>
@bajtos bajtos requested a review from juliangruber July 8, 2024 14:53
@bajtos bajtos merged commit 67fa72b into main Jul 8, 2024
13 checks passed
@bajtos bajtos deleted the fix-sandboxing-log branch July 8, 2024 15:05
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