Skip to content

Conversation

@iLLiCiTiT
Copy link
Member

@iLLiCiTiT iLLiCiTiT commented May 31, 2024

Description

Added option to download file to BytesIO and upload file from BytesIO.

Additional information

Sometimes it might be handy to be able to download content from server without storing it to a file but only to memory, or upload file from memory.

@iLLiCiTiT iLLiCiTiT requested a review from kalisp May 31, 2024 10:58
@BigRoy
Copy link
Contributor

BigRoy commented May 31, 2024

Side note is that ayon-python-api on pypi seems listed as Python 2 and Python 3 even though this change technically makes it Python 3.2+ compatible.

@iLLiCiTiT
Copy link
Member Author

iLLiCiTiT commented May 31, 2024

Side note is that ayon-python-api on pypi seems listed as Python 2 and Python 3 even though this change technically makes it Python 3.2+ compatible.

Good point will do PR changing it.

EDITED:
PR #156

@iLLiCiTiT iLLiCiTiT changed the title Download to IO stream Download and Upload using IO stream Jun 6, 2024
@kalisp
Copy link
Member

kalisp commented Jun 7, 2024

Code looks good, but I didn't know how to test it.
I wanted to mock downloading dependency package to BytesIO and then saving it:
image

but it failed:
image

Maybe its just my messed up test.

Copy link
Member

@kalisp kalisp left a comment

Choose a reason for hiding this comment

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

Last commit solved my issue. Checked upload_file_from_stream seems that is not suffering from same issue.

@kalisp kalisp assigned iLLiCiTiT and unassigned kalisp Jun 7, 2024
@iLLiCiTiT iLLiCiTiT merged commit abba5b0 into develop Jun 7, 2024
@iLLiCiTiT iLLiCiTiT deleted the enhancement/download-to-stream branch June 10, 2024 15:33
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.

4 participants