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

Validate open() mode #5896

Merged
merged 3 commits into from
Jan 21, 2022
Merged

Validate open() mode #5896

merged 3 commits into from
Jan 21, 2022

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Jan 20, 2022

Checks validity of the mode argument to open(). Prevents passing bad modes further down.

This was a // TODO from MicroPython.

Tested in the REPL with good and bad mode strings.

@dhalbert dhalbert requested review from tannewt and jepler January 20, 2022 22:24
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this improvement! One request

extmod/vfs_fat_file.c Outdated Show resolved Hide resolved
tannewt
tannewt previously approved these changes Jan 21, 2022
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@dhalbert
Copy link
Collaborator Author

@tannewt ready for review again: I had to shrink one build to fit.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tannewt tannewt merged commit f2713af into adafruit:main Jan 21, 2022
@dhalbert dhalbert deleted the open-modes-check branch February 6, 2022 15:07
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.

open() does not report invalid modes
2 participants