Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > problems debugging python script on server

Reply
Thread Tools

problems debugging python script on server

 
 
Yansky
Guest
Posts: n/a
 
      08-23-2008
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...pr=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.
 
Reply With Quote
 
 
 
 
eglyph@gmail.com
Guest
Posts: n/a
 
      08-23-2008

> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Disable script debugging from within script - IE Yansky Javascript 2 04-22-2007 05:30 AM
Third party script debugging on remote server ... dbee Python 4 04-19-2007 05:50 AM
Problems debugging script in aspx pages (vs2005) Namshub ASP .Net 3 11-15-2006 05:17 PM
Erratic Sever Side Script Debugging ASP 3.0/.NET DLLs: Problems and Solution ZMan ASP .Net 0 02-17-2004 12:08 AM
No Debugging of C# Server-Side Script, but Code-Behind Debugging Works Johann Blake ASP .Net 1 01-05-2004 03:01 PM



Advertisments