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 Jan 25, 2023
1 parent e39c7ba commit fa669ff
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 @@ -922,7 +922,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 @@ -930,7 +930,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 fa669ff

Please sign in to comment.