-
-
Notifications
You must be signed in to change notification settings - Fork 46.6k
Remove a slash in path to save the file correctly on Linux #8053
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - Great spot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good - Great spot
@@ -32,13 +32,13 @@ def main() -> None: | |||
letter_code = random_chars(32) | |||
file_name = paths[index].split(os.sep)[-1].rsplit(".", 1)[0] | |||
file_root = f"{OUTPUT_DIR}/{file_name}_FLIP_{letter_code}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file_root = f"{OUTPUT_DIR}/{file_name}_FLIP_{letter_code}" | |
file_root = os.path.join(OUTPUT_DIR, f"{file_name}_FLIP_{letter_code}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use pathlib
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file_root = f"{OUTPUT_DIR}/{file_name}_FLIP_{letter_code}" | |
file_root = Path(OUTPUT_DIR, f"{file_name}_FLIP_{letter_code}") |
@@ -32,13 +32,13 @@ def main() -> None: | |||
letter_code = random_chars(32) | |||
file_name = paths[index].split(os.sep)[-1].rsplit(".", 1)[0] | |||
file_root = f"{OUTPUT_DIR}/{file_name}_FLIP_{letter_code}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file_root = f"{OUTPUT_DIR}/{file_name}_FLIP_{letter_code}" | |
file_root = Path(OUTPUT_DIR, f"{file_name}_FLIP_{letter_code}") |
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}
.