johnfdutcher
Programmer
I Pickle a 'list' object in a script into a 'string' using 'pickle.dumps'.
I name the string variable as the 'value' of an HTML form 'input' object which is type 'hidden' on a form in the script.
I pass that string (using method=post) to another script which uses cgi.FieldStorage() to retrieve it.
If I then send that string to a script, using 'urllib2.Request()' with the 'data' parameter.... the 'pickle.loads' option fails with an 'invalid key argument' error. The noted argument is a '\n' (end of line ?).
This same script properly 'pickle.loads' any strings coming into it if they are sent 'directly' from a calling script using 'urllib2.Request()'... WITHOUT HAVING BEEN PASSED THRU the intermediate stage of being 'submitted' as part of a 'form field' prior to reaching the failing script.
It's as though being part of a form submission adulterates the 'pickle.dumps' string so that it is unacceptable for 'pickle.loads' ????
I name the string variable as the 'value' of an HTML form 'input' object which is type 'hidden' on a form in the script.
I pass that string (using method=post) to another script which uses cgi.FieldStorage() to retrieve it.
If I then send that string to a script, using 'urllib2.Request()' with the 'data' parameter.... the 'pickle.loads' option fails with an 'invalid key argument' error. The noted argument is a '\n' (end of line ?).
This same script properly 'pickle.loads' any strings coming into it if they are sent 'directly' from a calling script using 'urllib2.Request()'... WITHOUT HAVING BEEN PASSED THRU the intermediate stage of being 'submitted' as part of a 'form field' prior to reaching the failing script.
It's as though being part of a form submission adulterates the 'pickle.dumps' string so that it is unacceptable for 'pickle.loads' ????