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

Truncated upgrade_dir_name ending with space conflicts with directory path #110

Open
JieXiong9119 opened this issue Feb 2, 2024 · 0 comments
Assignees
Labels
bug Something isn't working postprocessing PR improves or adds postprocessing content

Comments

@JieXiong9119
Copy link
Collaborator

JieXiong9119 commented Feb 2, 2024

Bug found in comstock_measure_comparison.py under comstockpostproc

Description

When the upgrade dir name exceeeds 20 char and triggers the truncating operation in:

upgrade_dir_name = upgrade_dir_name[:20] # Truncate name to avoid long filepath errors on Windows

it might end with space if the last char in upgrade_dir_name is space. The space tail will be automatically dumped in the generated directory but will stay in the path name and this conflict will cause "FileNotFoundError: [Errno 2] No such file or directory:".

Suggestion

Logic needs to be added to handle this scenario, so that the last space in truncated upgrade_dir_name would be removed to match the generated directory.

@JieXiong9119 JieXiong9119 added bug Something isn't working postprocessing PR improves or adds postprocessing content labels Feb 2, 2024
@ChristopherCaradonna ChristopherCaradonna self-assigned this Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working postprocessing PR improves or adds postprocessing content
Projects
None yet
Development

No branches or pull requests

2 participants