I submitted one quite some time ago for Python 2 and python redis 2 and 3, 
but not for Python 3.  The fix I proposed here doesn't not work for Python 
2.    While I'd prefer to put sessions in redis, they work perfectly well 
in the database.  Redis works just fine (any version) as long as you're not 
use the redis_session.py in the web2py redis integration.

Long story short, I do not have a PR that fixes for redis 2 and 3 and 
python 2 and 3.

Any feel for how many people are using redis for sessions?

-Jim

On Thursday, November 28, 2019 at 3:47:36 PM UTC-6, Massimo Di Pierro wrote:
>
> Did I drop the ball on this one? I do not see a PR
>
> On Thursday, 21 November 2019 08:22:58 UTC-8, Jim S wrote:
>>
>> FWIW - I gave up on waiting.  Converted my sessions to use the database.
>>
>> I use redis in other parts of my app within web2py and am having no 
>> troubles there.  
>>
>> -Jim
>>
>> On Friday, November 15, 2019 at 1:45:25 PM UTC-6, Jim S wrote:
>>>
>>>
>>> Do you know much about sessions?  Are the values all supposed to be 
>>> binary?  The .decode on the 
>>>
>>> if to_native(rtn['unique_key']) == to_native(self.unique_key):
>>>
>>> was to convert it from binary to test against the string stored in 
>>> self.unique_key.
>>>
>>> Also, this fix isn't working in my python 2 installation.  I'm getting 
>>> other errors there but haven't had time to dig through it enough.
>>>
>>> But, I really appreciate you taking a look.  To me, this is a huge 
>>> problem that needs to be resolved.  Or, we have to stop using redis for 
>>> sessions or the web2py redis layer completely.
>>>
>>> -Jim
>>>
>>>
>>> On Friday, November 15, 2019 at 12:45:44 PM UTC-6, Leonel Câmara wrote:
>>>>
>>>> I haven't tried it, but I think the best fix is not to make the decode 
>>>> work by putting the obviously missing parenthesis. The fix is simply to 
>>>> remove the .decode, because to_native should take care of it, so this:
>>>>
>>>> rtn = {to_native(k.decode): v for k, v in self.db.r_server.hgetall(key
>>>> ).items()}
>>>>
>>>> Would become
>>>>
>>>> rtn = {to_native(k): v for k, v in self.db.r_server.hgetall(key).items
>>>> ()}
>>>>
>>>> The second decode you used is also probably wrong although it may work 
>>>> with python 3. I would say it should be like this
>>>>
>>>> if to_native(rtn['unique_key']) == to_native(self.unique_key):
>>>>
>>>> If no one makes a pull request in the mean time, I'll probably have 
>>>> time to test this later in the month and do it.
>>>>
>>>>

-- 
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/95493aef-fb20-4cf6-8de3-df732f87df6b%40googlegroups.com.

Reply via email to