PowWeb Forums - The Perfect Community for the Perfect Host  

Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more.

Go Back   PowWeb Community Forums > The PowWeb Platform > General Issues / Questions
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

View Poll Results: Do you use Python on a powweb hosted site?
Always 1 33.33%
Sometimes 1 33.33%
Not yet 0 0%
Never will 1 33.33%
Voters: 3. You may not vote on this poll

Reply
 
Thread Tools
Old 4-26-12, 11:07 AM   #1
shanimal
Registered
 
Join Date: Sep 2009
Location: Oakley, CA
Posts: 7
Reputation: 0
Python Error Reporting

I am trying to get errors from my python script without any luck. It just dies and reports

"The server encountered an unexpected condition which prevented it from fulfilling the request. The script had an error or it did not produce any output. If there was an error, you should be able to see it in the error log. "

If I send the content type headers in advance it seems to just die quietly.

UPDATE: I thought I would add this comment here in case someone else or me finds it again wondering how to print python errors.

PHP Code:

import sys
traceback
tb 
"no errors"
try:
    
"""do something here that raises an exception"""
except Exception as e:
    
tb traceback.format_exc()
finally:
    print 
"""Content-Type: text/plain; charset=utf8\n\n%s""" % (tb,) 
shanimal is offline   Reply With Quote
Old 4-26-12, 11:13 AM   #2
snowmaker
target='_blank'
 
snowmaker's Avatar
 
Join Date: Nov 2002
Location: Not in Solomons Island.
Posts: 3,278
Reputation: 318
You can check script error logs in OPS - CGI Error Logs
__________________
-bruce /* somdcomputerguy */
'If you change the way you look at things, the things you look at change.'
snowmaker is offline   Reply With Quote
Old 4-26-12, 11:19 AM   #3
shanimal
Registered
 
Join Date: Sep 2009
Location: Oakley, CA
Posts: 7
Reputation: 0
neat, thanks! how did you find this?

short of having shell access and running tail on the actual log, this is divine.

btw, do you happen to know where this log is located?
shanimal is offline   Reply With Quote
Old 4-26-12, 11:22 AM   #4
shanimal
Registered
 
Join Date: Sep 2009
Location: Oakley, CA
Posts: 7
Reputation: 0
yes. this rocks. thanks.
shanimal is offline   Reply With Quote
Old 4-26-12, 08:04 PM   #5
Builder
Thinkin' out loud again
 
Builder's Avatar
 
Join Date: Nov 2002
Location: Illinois
Posts: 1,955
Reputation: 272
Quote:
Originally Posted by shanimal View Post
btw, do you happen to know where this log is located?
In your /stats/ folder, same level as htdocs. cgi_error_log is the file name (no extension) and can be viewed in a text editor.

Good luck!
Kevin
__________________
A good friend will come and bail you out of jail...
but a true friend will be sitting next to you saying,
"Damn... that was fun!"
Builder is offline   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 Off
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:35 AM.


Contents ©PowWeb, Inc. ~ vBulletin, Copyright 2000-2007 Jelsoft Enterprises Limited.