Skip to content

Commit

Permalink
Merge pull request #165 from bakwc/155_future_warning
Browse files Browse the repository at this point in the history
#155 - FutureWarning on GzipFile
  • Loading branch information
bakwc authored Oct 20, 2022
2 parents 1c0dc6d + cbcfda2 commit d9c2deb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pysyncobj/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def serialize(self, data, id):
self.__serializer(tmpFile, data[1:])
else:
with open(tmpFile, 'wb') as f:
with gzip.GzipFile(fileobj=f) as g:
with gzip.GzipFile(fileobj=f, mode='wb') as g:
pickle.dump(data, g)

atomicReplace(tmpFile, self.__fileName)
Expand All @@ -102,7 +102,7 @@ def serialize(self, data, id):
def deserialize(self):
if self.__fileName is None:
with BytesIO(self.__inMemorySerializedData) as io:
with gzip.GzipFile(fileobj=io) as g:
with gzip.GzipFile(fileobj=io, mode='rb') as g:
return pickle.load(g)

if self.__deserializer is not None:
Expand Down

0 comments on commit d9c2deb

Please sign in to comment.