problems debugging python script on server

Discussion in 'Python' started by Yansky, Aug 23, 2008.

  1. Yansky

    Yansky Guest

    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.
    Yansky, Aug 23, 2008
    #1
    1. Advertising

  2. Yansky

    Guest


    > 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.
    , Aug 23, 2008
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Johann Blake
    Replies:
    1
    Views:
    1,184
    Hermit Dave
    Jan 5, 2004
  2. ZMan
    Replies:
    0
    Views:
    3,344
  3. Namshub
    Replies:
    3
    Views:
    333
    kferron
    Nov 15, 2006
  4. dbee
    Replies:
    4
    Views:
    383
    Graham Dumpleton
    Apr 19, 2007
  5. Yansky
    Replies:
    2
    Views:
    102
    Yansky
    Apr 22, 2007
Loading...

Share This Page