problems debugging python script on server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Yansky

    problems debugging python script on server

    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"+anchor Num

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

    Here is the form page where the link is submitted:

    Here is the code from the script that processes the form:


    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.
  • eglyph@gmail.com

    #2
    Re: problems debugging python script on server

    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.

    Comment

    Working...