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 3679666
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:29:11+00:00 2026-05-19T03:29:11+00:00

I have simple xmlrpc server code: from SimpleXMLRPCServer import SimpleXMLRPCServer port = 9999 def

  • 0

I have simple xmlrpc server code:

from SimpleXMLRPCServer import SimpleXMLRPCServer

port = 9999

def func():
    print 'Hi!'
    print x # error!
    print 'Bye!'

if __name__ == '__main__':
    server = SimpleXMLRPCServer(("localhost", port))
    print "Listening on port %s..." % port
    server.register_function(func)
    server.serve_forever()

Sample session.

Client:

>>> import xmlrpclib
>>> p = xmlrpclib.ServerProxy('http://localhost:9999')
>>> p.func()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python26\lib\xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "C:\Python26\lib\xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "C:\Python26\lib\xmlrpclib.py", line 1253, in request
    return self._parse_response(h.getfile(), sock)
  File "C:\Python26\lib\xmlrpclib.py", line 1392, in _parse_response
    return u.close()
  File "C:\Python26\lib\xmlrpclib.py", line 838, in close
    raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 1: "<type 'exceptions.NameError'>:global name 'x' is not defined">
>>>

Server:

Listening on port 9999...
Hi!
localhost - - [11/Jan/2011 16:17:09] "POST /RPC2 HTTP/1.0" 200 -

The question is if I can get this trace back also on server. I need to know if something went wrong with processing query. I’m not using client written in Python so it is hard for me to get traceback like above.

  • 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-19T03:29:11+00:00Added an answer on May 19, 2026 at 3:29 am

    You can do something like this:

    from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler
    
    port = 9999
    
    def func():
        print 'Hi!'
        print x # error!
        print 'Bye!'
    
    class Handler(SimpleXMLRPCRequestHandler):
         def _dispatch(self, method, params):
             try: 
                 return self.server.funcs[method](*params)
             except:
                 import traceback
                 traceback.print_exc()
                 raise
    
    
    if __name__ == '__main__':
        server = SimpleXMLRPCServer(("localhost", port), Handler)
        server.register_function(func)
        print "Listening on port %s..." % port
        server.serve_forever()
    

    Traceback server side:

    Listening on port 9999...
    Hi!
    Traceback (most recent call last):
      File "xml.py", line 13, in _dispatch
        value = self.server.funcs[method](*params)
      File "xml.py", line 7, in func
        print x # error!
    NameError: global name 'x' is not defined
    localhost - - [11/Jan/2011 17:13:16] "POST /RPC2 HTTP/1.0" 200 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have simple one column HTML files ( ebooks from Gutenberg Project). I want
I have simple code : URL url; BufferedReader in = null; HttpURLConnection connection; InputStream
I'm new to entity frame work code first. I have simple class called Cat
I have simple regex \.*\ for me its says select everything between and ,
Ok, i have simple scenario: have two pages: login and welcome pages. im using
In general, is it a best practice to have simple POJO Java classes implement
I develop tools in Autodesk Maya. Many of the tools I build have simple
Should simple JavaBeans that have only simple getters and setters be unit tested?? What
I have a simple webform that will allow unauthenticated users to input their information,
I have a simple 2-column layout with a footer that clears both the right

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.