Skip to content

Commit

Permalink
use the file handle properly for file payload saves
Browse files Browse the repository at this point in the history
  • Loading branch information
viseshrp committed Oct 21, 2024
1 parent 706248d commit 73be3d6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ansys/dynamicreporting/core/serverless/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def save(self, **kwargs):
# more general path, save the file into the media directory
with open(self._orm_instance.get_payload_server_pathname(), "wb") as out_file:
with self._file.open(mode="rb") as f:
for chunk in self._file.chunks():
for chunk in f.chunks():
out_file.write(chunk) # chunk -> bytes
super().save(**kwargs)

Expand Down

0 comments on commit 73be3d6

Please sign in to comment.