Azure / azure-functions-python-worker

Python worker for Azure Functions.
http://aka.ms/azurefunctions
MIT License
331 stars 100 forks source link

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

Open ssmid opened 1 week ago

ssmid commented 1 week ago

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

bhagyshricompany commented 2 days ago

Thanks for informing please share the all repro steps code snippet if possible.Thanks