Skip to content

Commit 99f5436

Browse files
committed
Do not truncate command name at ASCII NUL
Fakeredis was assuming that real redis treats the command name as a null-terminated string, but a Hypothesis test failure shows otherwise. I'm not sure how this hasn't failed before.
1 parent d675ee1 commit 99f5436

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

fakeredis/_server.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -761,8 +761,6 @@ def _blocking(self, timeout, func):
761761
return ret
762762

763763
def _name_to_func(self, name):
764-
# redis treats the command as NULL-terminated
765-
name = null_terminate(name)
766764
name = six.ensure_str(name, encoding='utf-8', errors='replace')
767765
func_name = name.lower()
768766
func = getattr(self, func_name, None)

0 commit comments

Comments
 (0)