500 Internal ... not the same of Dan
mk_999 at my-deja.com
mk_999 at my-deja.com
Tue Dec 7 08:54:50 EST 1999
Well, I'm a newbie of Python
and reading always this message is frustrating, because there is no
error in my code (I suppose).
I wrote a little code to upload files and register data on a database
(Oracle 8.0.4) using DCOracle. (plus Apache Web Server on Linux)
Sometimes doing this operation it shows me that message (INTERNAL SERVER
ERROR), but it works!!!!! if I control in the destination directory the
file is uploaded and in the database a new record is regularly
registered.
Refreshing the page, sometimes it shows the correct page, others not,
but it always add new records.
I used traceback (not so usefull in this case), and verified syntax on
command line (it seems all right).
I would be glad if someone showed me which way I can follow to solve
this problem.
There could be something wrong about the SQL, but why does it execute
the code anyway?!?
Here there is the function used to connect:
def db_update(product, title, author, descr, path):
try:
dbc=DCOracle.Connect("***/***@***")
if dbc:
cur=dbc.cursor() #get cursor
if cur:
stm = "INSERT INTO dev.procedure VALUES ( '%s', '%s', '%s', '%s',
TO_DATE(sysdate,'DD-MM-RRRR') ,'%s')" % (prodotto, title, author, descr,
path)
#print stm
cur.execute(stm)
else:
print 'Invalid SQL statement'
cur.close()
dbc.close()
else:
print 'Unable to connect to db'
except:
print 'Error on connection'
if dbc:
if cur:
cur.close()
dbc.close()
Thanks for every suggest, Luca
Sent via Deja.com http://www.deja.com/
Before you buy.
More information about the Python-list
mailing list