Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 596207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:08:49+00:00 2026-05-13T16:08:49+00:00

I have created a simple Python XML-RPC implementation, largely based on the examples. However,

  • 0

I have created a simple Python XML-RPC implementation, largely based on the examples.

However, it sends output like this:

foo.bar.com - - [13/Feb/2010 17:55:47] "POST /RPC2 HTTP/1.0" 200 -

… to the terminal, even if I redirect standard out and standard error to a file using >> or >. I’m doing this with the following line:

python foobar 2>&1 >> foobar.log

It seems almost like it’s not sending to standard out, but somewhere else.

Also, when an exception occurs on recieving a request, the whole application crashes with this error:

----------------------------------------
Exception happened during processing of request from ('1.2.3.4', 51284)

How can I handle this exception? I need to recover gracefully, and just log the exception message rather than the server crashing.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T16:08:49+00:00Added an answer on May 13, 2026 at 4:08 pm

    I guess you’re using the SimpleXMLRPCServer class from the examples. In that case, simply provide the parameter logRequests when creating it:

    server = SimpleXMLRPCServer(("localhost", 8000), logRequests = False)
    

    That will suppress request logging.

    As for the exceptions, they’re logged in BaseServer (cf. source code of “SocketServer.py”):

    def handle_error(self, request, client_address):
        """Handle an error gracefully.  May be overridden.
    
        The default is to print a traceback and continue.
    
        """
        print '-'*40
        print 'Exception happened during processing of request from',
        print client_address
        import traceback
        traceback.print_exc() # XXX But this goes to stderr!
        print '-'*40
    

    As you can see, the first part is written to stdout, which is why &2>1 didn’t work completely. If you want to suppress them, override or overwrite that method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a simple Python module and want to distribute it with pip.
I have a simple python curses code that creates a subwindow. However, in the
Could someone help me on this, I have created simple web services using axis2
I have created this simple program to learn shared_ptr using namespace std; #define Yes
I have created a simple test harness in python for my ASP .net web
I have created a simple python web site using Google App Engine. Currently, the
I have a simple python telnet based chat server that lacks the functionality for
I am self teaching myself some python OOP, and I have created a simple
I'm learning python and PyGTK now, and have created a simple Music Organizer. http://pastebin.com/m2b596852
I have created a simple gui with curses. However, when the curses menu is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.