You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using eval to run Lua script, when iterating over ARGV using the following code:
for i, v in ipairs(ARGV) do
end
An exception is thrown:
/home/ubuntu/venv3/lib/python3.5/site-packages/fakeredis.py:2201: in execute
for name, args, kwargs in self.commands]
/home/ubuntu/venv3/lib/python3.5/site-packages/fakeredis.py:2201: in <listcomp>
for name, args, kwargs in self.commands]
/home/ubuntu/venv3/lib/python3.5/site-packages/fakeredis.py:221: in decode_response
val = _decode(func(*args, **kwargs))
/home/ubuntu/venv3/lib/python3.5/site-packages/fakeredis.py:342: in func_wrapper
return func(*args, **kwargs)
/home/ubuntu/venv3/lib/python3.5/site-packages/fakeredis.py:849: in eval
result = lua_runtime.execute(script)
lupa/_lupa.pyx:277: in lupa._lupa.LuaRuntime.execute
???
lupa/_lupa.pyx:1294: in lupa._lupa.run_lua
???
lupa/_lupa.pyx:1303: in lupa._lupa.call_lua
???
lupa/_lupa.pyx:1328: in lupa._lupa.execute_lua_call
???
lupa/_lupa.pyx:250: in lupa._lupa.LuaRuntime.reraise_on_exception
???
lupa/_lupa.pyx:1571: in lupa._lupa.py_object_getindex_with_gil
???
???
E IndexError: list index out of range
The code is working just fine against a real Redis.
Look like it happens due to ARGV being POBJECT (a Lupa's type?) instead of a regular Lua table.
The same happens when trying to iterate over the results of redis.call('HGETALL', key)
The text was updated successfully, but these errors were encountered:
NimrodParasol
changed the title
Can't Iterate over ARGV in Lua scripting
Can't Iterate over ARGV or HGETALL results in Lua scripting
Aug 19, 2018
Thanks for the report. I don't know much about Lua myself, so the only way this is likely to get fixed is if someone (such as yourself) can contribute a pull request.
When using
eval
to run Lua script, when iterating over ARGV using the following code:An exception is thrown:
The code is working just fine against a real Redis.
Look like it happens due to
ARGV
beingPOBJECT
(a Lupa's type?) instead of a regular Lua table.The same happens when trying to iterate over the results of
redis.call('HGETALL', key)
The text was updated successfully, but these errors were encountered: