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 19, 2022
1 parent 12f95de commit c9dfad3
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 c9dfad3

Please sign in to comment.