Re: Pickle in a POST/GET request give EOFError

2010-11-18 Thread Adam Tauno Williams
On Thu, 2010-11-18 at 11:22 +0100, Romaric DEFAUX wrote: > Hi again, > I try simplejson, but I have a problem. (I just replace pickle > everywhere by simplejson) > Explanation : > I "dumps" with json a list of dictionnaries into disk_list_json. > When I "loads" it, I don't get my list of dictionn

Re: Pickle in a POST/GET request give EOFError

2010-11-18 Thread Romaric DEFAUX
Hi answer to myself :) With str(unicode_string) ! Le 18/11/2010 12:23, Romaric DEFAUX a écrit : Sorry for this stupid question, but how can I convert unicode to string. I ask that because I hit an error (perhaps a bug) in mod_wsgi, and that crash the apache process : TypeError: sequence of s

Re: Pickle in a POST/GET request give EOFError

2010-11-18 Thread Romaric DEFAUX
Sorry for this stupid question, but how can I convert unicode to string. I ask that because I hit an error (perhaps a bug) in mod_wsgi, and that crash the apache process : TypeError: sequence of string values expected, value of type unicode found RuntimeError: generator ignored GeneratorExit ch

Re: Pickle in a POST/GET request give EOFError

2010-11-18 Thread Michael Ricordeau
When loading from json datas with simplejson, strings are unicode . Le Thu, 18 Nov 2010 11:22:30 +0100, Romaric DEFAUX a écrit : > Hi again, > > I try simplejson, but I have a problem. (I just replace pickle > everywhere by simplejson) > > Here's a test I did : > # python > Python 2.5.2 (r2

Re: Pickle in a POST/GET request give EOFError

2010-11-18 Thread Romaric DEFAUX
Hi again, I try simplejson, but I have a problem. (I just replace pickle everywhere by simplejson) Here's a test I did : # python Python 2.5.2 (r252:60911, Jan 20 2010, 21:48:48) [GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2 Type "help", "copyright", "credits" or "license" for more information

Re: Pickle in a POST/GET request give EOFError

2010-11-18 Thread Romaric DEFAUX
Thanks for the tip, I'll do that :) Le 18/11/2010 09:43, Michael Ricordeau a écrit : Hi, you can use json for passing list and dict . Pickle is dangerous . Instead of pickle.loads/pickle.dumps use json.loads and json.dumps (using stdlib json in python>= 2.6 or simplejson in python< 2.6) Rega

Re: Pickle in a POST/GET request give EOFError

2010-11-18 Thread Michael Ricordeau
Hi, you can use json for passing list and dict . Pickle is dangerous . Instead of pickle.loads/pickle.dumps use json.loads and json.dumps (using stdlib json in python >= 2.6 or simplejson in python < 2.6) Regards Le Thu, 18 Nov 2010 09:29:00 +0100, Romaric DEFAUX a écrit : > Le 17/11/201

Re: Pickle in a POST/GET request give EOFError

2010-11-18 Thread Romaric DEFAUX
Le 17/11/2010 18:52, geremy condra a écrit : On Wed, Nov 17, 2010 at 6:44 AM, Romaric DEFAUX wrote: Le 16/11/2010 17:47, Romaric DEFAUX a écrit : Hi everybody ! First time I write to this mailing list :) I started writing in python last week, that's probably why I can't understand t

Re: Pickle in a POST/GET request give EOFError

2010-11-17 Thread Adam Tauno Williams
On Wed, 2010-11-17 at 15:44 +0100, Romaric DEFAUX wrote: > After entirely rewrite my code to not use Web service but socket (a real > client/server program) I finally found the problem... And it's not > linked to the POST or GET method... > It's because of that : > g.db.escape_string(fields['hos

Re: Pickle in a POST/GET request give EOFError

2010-11-17 Thread Romaric DEFAUX
Le 16/11/2010 17:47, Romaric DEFAUX a écrit : Hi everybody ! First time I write to this mailing list :) I started writing in python last week, that's probably why I can't understand the following problem... I create a list called web_site_list. This list contain dictionaries called web_site