473,385 Members | 1,907 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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"+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.
Aug 23 '08 #1
1 1053
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 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: daniel.poelzleithner | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, i wrote a module for ctrlproxy which embedds python and provides an api that ctrlproxy is scriptable. Every script is started in an own...
1
by: jim.eggleston | last post by:
I just figured out a reasonably decent way to use pdb in SciTE for debugging Python scripts. Debugging takes place in the SciTE output window. I have only tested this with SciTE on Windows. Here...
0
by: ZMan | last post by:
Scenario: This is about debugging server side scripts that make calls to middle-tier business DLLs. The server side scripts are legacy ASP 3.0 pages, and the DLLs are managed DLLs...
5
by: Velvet | last post by:
Can someone tell me to what process I need to attach to be able to step through my classic ASP code in VS.net 2003. I'm working on an XP box with IIS installed. I also have VS.net 2005 (The...
2
by: goodnamesalltaken | last post by:
Hello fellow python users, I've been working on a basic implementation of a privilege separated web server, and I've goto the point of running a basic cgi script. Basically when the execCGI...
5
by: rn5a | last post by:
Can someone please suggest me a text editor especially for DEBUGGING ASP scripts apart from Microsoft Visual Interdev? I tried using Visual Interdev & created a project but Interdev generates...
4
by: dbee | last post by:
Right. I've got a really, really annoying/difficult/time consuming problem with my development environment. I'm using django to build a web app with paypal integration. My server is hosted...
0
by: eddiefisher41 | last post by:
Hey guys. Im having problems running a python cgi. Im using the example code from: http://www.python.org/doc/essays/ppt/sd99east/sld041.htm as writen by Van Rossum himself I can get the script...
0
by: Gabriel Genellina | last post by:
En Wed, 03 Sep 2008 05:29:39 -0300, Edward FISHER <edward.fisher@st.com> escribi�: That's a server setting (Apache or whatever) - make sure it is configured to *execute* the script. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.