Skip to content

Commit

Permalink
Fix issue with pack_commands returning an empty byte sequence
Browse files Browse the repository at this point in the history
  • Loading branch information
jmcbailey committed Oct 13, 2022
1 parent 936d49f commit 0841e06
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion redis/asyncio/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,8 @@ def pack_commands(self, commands: Iterable[Iterable[EncodableT]]) -> List[bytes]
or chunklen > buffer_cutoff
or isinstance(chunk, memoryview)
):
output.append(SYM_EMPTY.join(pieces))
if pieces:
output.append(SYM_EMPTY.join(pieces))
buffer_length = 0
pieces = []

Expand Down
3 changes: 2 additions & 1 deletion redis/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,8 @@ def pack_commands(self, commands):
or chunklen > buffer_cutoff
or isinstance(chunk, memoryview)
):
output.append(SYM_EMPTY.join(pieces))
if pieces:
output.append(SYM_EMPTY.join(pieces))
buffer_length = 0
pieces = []

Expand Down

0 comments on commit 0841e06

Please sign in to comment.