-
Notifications
You must be signed in to change notification settings - Fork 972
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
convert windows path delimiter to posix (#2149) #2150
base: develop
Are you sure you want to change the base?
Conversation
data = f"/{file.relative_to(input_dir).as_posix()}\x00" | ||
comment = f"\"/{file.relative_to(input_dir).as_posix()}\" ({len(data)} chars)" |
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.
Might be worth doing a small refactoring here, so that the file.relative_to(input_dir).as_posix()
is done just once (and assigned to a new variable) ?
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.
I agree that this minor refactor would make it a bit cleaner for sure.
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.
Perhaps separate refactoring from delimiter handling to make changes more consistent, since there are some format strings that could be refactored ? Perhaps add a new issue for refactoring ?
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.
The overall fix looks good to me.
data = f"/{file.relative_to(input_dir).as_posix()}\x00" | ||
comment = f"\"/{file.relative_to(input_dir).as_posix()}\" ({len(data)} chars)" |
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.
I agree that this minor refactor would make it a bit cleaner for sure.
Fixes #2149
When generating lwip file system data convert windows directory separators by posix separators.
This is an issue when native directory during resource generation separator is "\" as on windows. Running toolchain from mingw64 python3 would also preserve "\" in resource name which would cause mismatch on resource lookup.
Fix should be portable with python 3.4 and up.