Skip to content

Commit fa669ff

Browse files
committed
Fix issue with pack_commands returning an empty byte sequence
1 parent e39c7ba commit fa669ff

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

redis/asyncio/connection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -922,7 +922,8 @@ def pack_commands(self, commands: Iterable[Iterable[EncodableT]]) -> List[bytes]
922922
or chunklen > buffer_cutoff
923923
or isinstance(chunk, memoryview)
924924
):
925-
output.append(SYM_EMPTY.join(pieces))
925+
if pieces:
926+
output.append(SYM_EMPTY.join(pieces))
926927
buffer_length = 0
927928
pieces = []
928929

redis/connection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,8 @@ def pack_commands(self, commands):
930930
or chunklen > buffer_cutoff
931931
or isinstance(chunk, memoryview)
932932
):
933-
output.append(SYM_EMPTY.join(pieces))
933+
if pieces:
934+
output.append(SYM_EMPTY.join(pieces))
934935
buffer_length = 0
935936
pieces = []
936937

0 commit comments

Comments
 (0)