Add arbitrary io buffer support to reader#234
Merged
horgh merged 7 commits intomaxmind:mainfrom Aug 11, 2025
Merged
Conversation
Contributor
Author
|
I will fix the import order for the test file, on the complexity of the init function it would help to get some maintainer input before proceeding, disabling/increasing the value is not something I feel comfortable making a decision on for a driveby pr. Edit: nvm I can just reduce the complexity ig |
4e4fb20 to
5ce419e
Compare
horgh
requested changes
Aug 8, 2025
Contributor
horgh
left a comment
There was a problem hiding this comment.
Looks good, thank you! I have one comment.
maxminddb/reader.py
Outdated
| def _load_buffer( | ||
| self, database: AnyStr | int | PathLike | IO, mode: int = MODE_AUTO | ||
| ) -> None: | ||
| self.filename: Any |
Contributor
There was a problem hiding this comment.
Rather than making this a public attribute, what do you think about returning it from this function?
Contributor
Author
There was a problem hiding this comment.
Fine for me, changed it
horgh
added a commit
that referenced
this pull request
Aug 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR closes #232
Went with the suggested method of defaulting the filename to f"< type >" if it doesn't exist. The test has to work around the workaround which is used to avoid having to open files manually, I added a comment on it to explain why it is needed.