problems debugging python script on server

Y

Yansky

I'm having some problems debugging a python script on my server. I'm
getting a "500 Internal Server Error".

What the script does is take a link and then scrape a page and store
some info from the page into a database. It seemed to be working fine
until I changed one line of code from:
shortenLink = "/forum-replies.cfm?t="+threadNum+"&p="+pageNum
+"#r"+anchorNum

to:
shortenLink = "/forum-replies.cfm?t="+threadNum+"&p="+pageNum
+"#r"+anchorNum
if pageNum == '1':
shortenLink = "/forum-replies.cfm?t="+threadNum+"#r"+anchorNum

Here is the form page where the link is submitted:
http://goodbyepolar.com/cgi-bin/avatar.py
Here is the code from the script that processes the form:
http://codedumper.com/avuno

You can use this URL in the form page to generate the "500 Internal
Server Error": http://forums.whirlpool.net.au/forum-replies-herring.cfm?r=16373017&tpr=1035665,1,2

As you can see from my codedump, I'm using import cgitb;
cgitb.enable() to try to find the error, but with no success. I'm
really at a loss as to why it's generating this error. Any help would
be appreciated.
Cheers.
 
E

eglyph

cgitb.enable() to try to find the error, but with no success. I'm
really at a loss as to why it's generating this error.

Apache's error_log and access_log are your friends.

In this particular case your script breaks something http-server
related: premature end of headers, incorrect permissions on script,
wrong interpreter script, etc. Anyway the right reason is in the http
server's logs.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,222
Members
46,809
Latest member
moe77

Latest Threads

Top