I just messed with this a little bit and got past the login with python3, 
web2py and redis.

Here is the code, lines 185 thru 192 of redis_session.py:

            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

Added the parens after the k.decode in the first line and added the .decode 
after rtn['unique_key'] in the 4th line.  I did not submit a PR because I 
don't understand what is going on here.  

self.db.r_server.hgetall(key).items returns a list of value pairs that the 
first line converts to a dict.  However, after the dict is built, all the 
values are in binary.  The 'unique_key' value needs needs to NOT be 
binary.  However, it appears as though the 'session_data' needs to be  
binary.  

Should everything EXCEPT the session_data be converted from binary?  I'm 
hoping the maintainer of redis_session.py could chime in with what is 
expected so we can get this fixed.

But, at least I finally got past the login...

Thoughts?

-Jim


On Tuesday, November 12, 2019 at 4:00:10 PM UTC-6, Jim S wrote:
>
> Just wondering if there has  been any further work on this.
>
> I'm working on converting all to python 3 but this is keeping us from 
> moving right now.
>
> -Jim
>
> On Wednesday, November 6, 2019 at 5:34:16 PM UTC-6, Jim S wrote:
>>
>> Same here.  I've reported and submitted a fix but it was rejected.  It 
>> worked for all of our use cases.
>>
>> On Wednesday, November 6, 2019 at 9:19:07 AM UTC-6, Leonel Câmara wrote:
>>>
>>> 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.
>>>
>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/226ec208-3395-4a1c-a7ef-898b1d8e6236%40googlegroups.com.

Reply via email to