I will confirm that it was redis 3 that broke this.

Jim


On Mon, Sep 9, 2019, 6:57 PM rastafarien <stephane.krikor...@gmail.com>
wrote:

> It seems that redis3 introduced a couple of nasty breaking changes.
>
> Yes it "used to" work with python2 as well, but more testing is welcomed !
>
> Stephane
>
>
> Le mardi 10 septembre 2019 00:04:53 UTC+2, Joe Barnhart a écrit :
>>
>> If you're asking if it runs unmodified under Python2 I do not know as of
>> yet.  I would need to e off a Python2 site, apply the patch, configure it
>> for redis, and test.
>>
>> That might happen in a week or two as I don't have a Python2/redis site
>> right now so I need to do some work to create a test bench for this.
>>
>> If someone else has a Python2/redis site already they may be able to test
>> it quicker.
>>
>> -- Joe
>>
>> On Monday, September 9, 2019 at 3:00:50 PM UTC-7, Jim S wrote:
>>>
>>> Is it backward compatible as well?
>>>
>>> -Jim
>>>
>>> On Mon, Sep 9, 2019 at 4:54 PM Joe Barnhart <joe.b...@gmail.com> wrote:
>>>
>>>> YES.  This seems to work fine in my case.  It permits me to save both
>>>> sessions and cache data to redis using Python3.  Maybe we can get it
>>>> accepted and blessed for the next release.
>>>>
>>>> Joe
>>>>
>>>> On Monday, September 9, 2019 at 1:03:51 PM UTC-7, rastafarien wrote:
>>>>>
>>>>> Hello
>>>>>
>>>>> I have also proposed a patch to make redis work with my applications
>>>>> under wep2py latest ( 2.18.5-stable+timestamp.2019.04.08.04.22.03)
>>>>> and python3
>>>>> it is attached to this post.
>>>>> "onetwomany" also released a patch.
>>>>>
>>>>> Basically
>>>>>
>>>>> 2 files are to be adjusted : redis_session.py and global.py
>>>>>
>>>>> 1/ Redis does not support bool so I replaced False by 0
>>>>> 2/ Redis does not support datetime so I replaced datetime by
>>>>> str(datetime)
>>>>>
>>>>> Under linux and python3, I found out that it was the only way to have
>>>>> the "welcome" application ( and also my own applications) to work in a
>>>>> multinode environment accessing a distributed redis server for session
>>>>> caching.
>>>>> Let us know if it solves your problem.
>>>>> Regards
>>>>> Stephane
>>>>>
>>>>>
>>>>> Le lundi 9 septembre 2019 18:27:20 UTC+2, Joe Barnhart a écrit :
>>>>>>
>>>>>> I sure wish somebody could fix this.  It's a real bottleneck to
>>>>>> Python3 adoption for my site.  I tried using local storage for sessions 
>>>>>> but
>>>>>> the limitation on data size makes it a no-go for my site.  If I can't use
>>>>>> redis I'll have to drop back to storing sessions in files and that really
>>>>>> sucks for a larger deployment.
>>>>>>
>>>>>> -- Joe
>>>>>>
>>>>>> On Monday, April 1, 2019 at 11:31:10 PM UTC-7, Massimo Di Pierro
>>>>>> wrote:
>>>>>>>
>>>>>>> we could change True/False with 1/0 but a better approach would be
>>>>>>> to remove the value within the redis adapter. The value of locked does 
>>>>>>> not
>>>>>>> do anything anyway on redis since it is not a relational database with
>>>>>>> transactions.
>>>>>>>
>>>>>>> On Sunday, 31 March 2019 10:19:20 UTC-7, Jim S wrote:
>>>>>>>>
>>>>>>>> I changed the following in gluon/globals.py and mine is working
>>>>>>>> now.  But, I'm unclear on how to test to see if it is handling the 
>>>>>>>> locking
>>>>>>>> properly:
>>>>>>>>
>>>>>>>> dd = dict(locked=False,
>>>>>>>>           client_ip=response.session_client,
>>>>>>>>           modified_datetime=request.now,
>>>>>>>>           session_data=session_pickled,
>>>>>>>>           unique_key=unique_key)
>>>>>>>>
>>>>>>>> to
>>>>>>>>
>>>>>>>> dd = dict(locked='False',
>>>>>>>>           client_ip=response.session_client,
>>>>>>>>           modified_datetime=str(request.now),
>>>>>>>>           session_data=session_pickled,
>>>>>>>>           unique_key=unique_key)
>>>>>>>>
>>>>>>>> This makes all my stuff work (I'm still on Python 2.7 but I think
>>>>>>>> the problem has to do with the python redis client moving to version 
>>>>>>>> 3).
>>>>>>>>
>>>>>>>> Leonel - I think this relates back to an issue you commented on
>>>>>>>> late last year.
>>>>>>>> https://groups.google.com/forum/?pli=1#!searchin/web2py/redis%7Csort:date/web2py/PdquGF_9a2E/6VJpLqsnBgAJ
>>>>>>>>
>>>>>>>> At that time I just continued using python redis 2.10.6.  But,
>>>>>>>> can't do that forever.  Anyone able to test or improve upon the change 
>>>>>>>> I
>>>>>>>> made above?  Like I said, it works for me, but I don't know how to see 
>>>>>>>> if
>>>>>>>> I'm causing any other unforeseen damage.
>>>>>>>>
>>>>>>>> -Jim
>>>>>>>>
>>>>>>>> On Friday, March 29, 2019 at 7:49:03 PM UTC-5, Joe Barnhart wrote:
>>>>>>>>>
>>>>>>>>> Hi Leonel --
>>>>>>>>>
>>>>>>>>> My brain refuses to put together the words "session locked
>>>>>>>>> field".  I understand the part of pickle smashing the values and 
>>>>>>>>> encoding
>>>>>>>>> them as one string.  The bool has something to do with session 
>>>>>>>>> locking?
>>>>>>>>>
>>>>>>>>> I've only looked at the web2py redis code in the most scant way as
>>>>>>>>> I wasn't planning to become a redis expert.  Sessions in redis could 
>>>>>>>>> be
>>>>>>>>> important to me, tho, so I may need to set aside some time to dig 
>>>>>>>>> into it.
>>>>>>>>>  (Storing sessions in cookies has been problematic due to the limited 
>>>>>>>>> space
>>>>>>>>> for cookies in browsers.)
>>>>>>>>>
>>>>>>>>> -- Joe
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Wednesday, March 27, 2019 at 4:49:25 PM UTC-7, Leonel Câmara
>>>>>>>>> wrote:
>>>>>>>>>>
>>>>>>>>>> It's not your values Joe, pickle serializes them as a string so
>>>>>>>>>> they would be fine. It's web2py session locked field which is True or
>>>>>>>>>> False. It's probably easy to fix this in redis_session.py
>>>>>>>>>>
>>>>>>>>> --
>>>> 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 a topic in the
>>>> Google Groups "web2py-users" group.
>>>> To unsubscribe from this topic, visit
>>>> https://groups.google.com/d/topic/web2py/0iU2wqSik0k/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> web...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/web2py/9ed9f575-1764-4dab-a93c-d7ec68e57638%40googlegroups.com
>>>> <https://groups.google.com/d/msgid/web2py/9ed9f575-1764-4dab-a93c-d7ec68e57638%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/0iU2wqSik0k/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/d6b522f1-66c2-4392-ac4d-11758d3ddc16%40googlegroups.com
> <https://groups.google.com/d/msgid/web2py/d6b522f1-66c2-4392-ac4d-11758d3ddc16%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAERBpoA%3D6WOYK%2BzrDGFWX_L%3Dd89Bj7_roF5D%2BH99iirMfMa80A%40mail.gmail.com.

Reply via email to