rfc822 from 1.5.2 fails when called from cgi

max at rightworks.com max at rightworks.com
Wed Jul 7 02:51:02 EDT 1999


I have a cgi app that is failing with 1.5.2 version of rfc822.  When I
post a multi-part form, sometimes, I get the failure shown below. It is
interesting that running the same data doesn't always fail. I have tried
to put trace in, and it varies which iteration thru readheaders it fails
on.  I have tried to trace with print stmts (can't always run debugger
inside of cgi) and can't figure it out.
    form = FieldStorage()
  File "G:\Python\Lib\cgi.py", line 869, in __init__
    self.read_multi(environ, keep_blank_values, strict_parsing)
  File "G:\Python\Lib\cgi.py", line 954, in read_multi
    headers = rfc822.Message(self.fp)
  File "G:\Python\Lib\rfc822.py", line 92, in __init__
    self.readheaders()
  File "G:\Python\Lib\rfc822.py", line 137, in readheaders
    startofline = tell()
IOError: (0, 'Error')

the file it it parsing looks something like:

Content-type: multipart/form-data;
boundary=---------------------------119851875720143
Content-Length: 565

-----------------------------119851875720143
Content-Disposition: form-data; name="SI"

0000000S
-----------------------------119851875720143
Content-Disposition: form-data; name="command_file";
filename="D:\ProcureWorks\WebDriver\t.txt"
Content-Type: text/plain

# Adding 1 User
*delimiter ","
*userdata username,last_name,first_name,e_mail,EMPLOYEE_ID
ruipeng2,Mai,Ruipeng,ruipeng at rightworks.com,18


-----------------------------119851875720143
Content-Disposition: form-data; name="verbose"

on
-----------------------------119851875720143--

If I run with the ver 1.5.2 of rfc882 it works fine.
any help appreciated.
max


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.




More information about the Python-list mailing list