Traceback (most recent call last):
File "/home/jose/python-environments/winp_ca/lib/web2py/gluon/restricted.py", line 219, in restricted
exec(ccode, environment)
File "/home/jose/python-environments/winp_ca/lib/web2py/applications/winp_ca/models/0_init.py", line 56, in <module>
session.connect(request, response, db = sessiondb)
File "/home/jose/python-environments/winp_ca/lib/web2py/gluon/globals.py", line 971, in connect
row = table(record_id, unique_key=unique_key)
File "/home/jose/python-environments/winp_ca/lib/web2py/gluon/contrib/redis_session.py", line 117, in __call__
row = q.select()
File "/home/jose/python-environments/winp_ca/lib/web2py/gluon/contrib/redis_session.py", line 185, in select
rtn = {to_native(k.decode): v for k, v in self.db.r_server.hgetall(key).items()}
File "/home/jose/python-environments/winp_ca/lib/web2py/gluon/contrib/redis_session.py", line 185, in <dictcomp>
rtn = {to_native(k.decode): v for k, v in self.db.r_server.hgetall(key).items()}
File "/home/jose/python-environments/winp_ca/lib/web2py/gluon/packages/dal/pydal/_compat.py", line 136, in to_native
return obj.decode(charset, errors)
AttributeError: 'builtin_function_or_method' object has no attribute 'decode'
We also got this bug when we tried to upgrade to the latest web2py and had to rollback. We were using the old 2.X pyredis and then tried with 3.X you get the same problem with both. Please report this issue in github, if no one fixes it we will probably end up fixing it as we also need this fix.
rtn = {to_native(k.decode()): v for k, v in self.db.r_server.hgetall(key).items()}
if rtn:
if self.unique_key:
# make sure the id and unique_key are correct
if rtn['unique_key'].decode() == to_native(self.unique_key):
rtn['update_record'] = self.update # update record support
else:
rtn = None
rtn = {to_native(k.decode): v for k, v in self.db.r_server.hgetall(key).items()}
rtn = {to_native(k): v for k, v in self.db.r_server.hgetall(key).items()}
if to_native(rtn['unique_key']) == to_native(self.unique_key):
if to_native(rtn['unique_key']) == to_native(self.unique_key):
Any feel for how many people are using redis for sessions?
py4web does sessions in redis by default (if you have redis). Just saying.
py4web does sessions in redis by default (if you have redis). Just saying.