azure-functions-python-worker icon indicating copy to clipboard operation
azure-functions-python-worker copied to clipboard

[BUG] FileStorage.save() silently fails when called multiple times

Open ssmid opened this issue 8 months ago • 2 comments

Problem: When FileStorage.save() is called a second time, it saves 0 bytes into a file because its underlying stream is used up.

Expected: Raises an error when called more than once.

Solution: Set self.stream to None after it has been used and check if self.stream is None already.

https://github.com/Azure/azure-functions-python-library/blob/fc78a0691d6da4b9860346a79f9f30fb87ba135f/azure/functions/_thirdparty/werkzeug/datastructures.py#L2796

ssmid avatar Jun 17 '24 11:06 ssmid