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

retrieval: remove unnecessary decode-encode step #2555

Merged
merged 1 commit into from
Feb 28, 2022

Conversation

abhidg
Copy link
Contributor

@abhidg abhidg commented Feb 28, 2022

This should fix MemoryError on attempting encoding

Copy link
Contributor

@iamleeg iamleeg left a comment

Choose a reason for hiding this comment

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

Do we need to read the file in at all? We immediately wrap the in-memory content with a file-like object. I think this could be replaced by opening the file-like object and returning that.

This should fix MemoryError on attempting encoding
@abhidg abhidg force-pushed the fix-memoryerror-retrieval-encode branch from 062d4b9 to 3fc6bc5 Compare February 28, 2022 10:17
Copy link
Contributor

@iamleeg iamleeg left a comment

Choose a reason for hiding this comment

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

This can also be done in the other code paths where we construct a BytesIO :). In fact in some places we're just copying the file via calls to read and write, could get the OS to do that for us.

@abhidg abhidg merged commit 064d0e3 into main Feb 28, 2022
@abhidg abhidg deleted the fix-memoryerror-retrieval-encode branch February 28, 2022 10:29
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.

2 participants