need some cgi help please

nephish at nephish at
Wed Jun 8 04:15:26 CEST 2005

Hey there. Here is the deal.... i have a script that is supposed to
open a file based on criteria from a web form.
i cant seem to get it to work though.

here is the code:

form = cgi.FieldStorage()
DataRecord = form['DataTime'].value
Customer = form['CustName'].value # should be automatically filled in

print "Content-Type: text/html\n\n"

WorkingFile =
all_lines = WorkingFile.readlines()
for line in all_lines:
	print line

here is the error:
WorkingFile undefined, builtin open = <type 'file'>, Customer =
'tenderloin', DataRecord = 'Tue Jun 7 20:13:35 2005.txt'

IOError: [Errno 2] No such file or directory:
'/var/www/stretch/web_root/SidCrops/tenderloin/Tue Jun 7 20:13:35
      args = (2, 'No such file or directory')
      errno = 2
      filename = '/var/www/stretch/web_root/SidCrops/tenderloin/Tue Jun
7 20:13:35 2005.txt'
      strerror = 'No such file or directory'

here is the deal.... the file is there ! i run similar code in idle and
it works.
i just dont get it. it isn't a permissions issue, its chmod  777 all
the way.
i gotta find out why this is goofing on me... 

please help me!

More information about the Python-list mailing list