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

  • Home
  • SEARCH
  • 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 9183031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:42:10+00:00 2026-06-17T18:42:10+00:00

On the server side of a xmlrpc server in python I have the following

  • 0

On the server side of a xmlrpc server in python I have the following line of code within a function overwriting SimpleXMLRPCServer._marshaled_dispatch:

response = xmlrpclib.dumps(
            xmlrpclib.Fault(1, "some error\nnext line\n"),
            encoding=self.encoding, allow_none=self.allow_none)

to create some custom error/fault message to be show on the client side. However, this code will show something like the following on the client side

xmlrpclib.Fault: <Fault 1: "some error\nnext line\n">

whereas I want to have something like

xmlrpclib.Fault: <Fault 1: "some error
next line
">

i.e. where the newline character is actually ‘used’ and not printed.

Any ideas I can accomplish this (per server side, i.e. modification of the line just shown above, and without using a third party package.)?

  • 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-06-17T18:42:12+00:00Added an answer on June 17, 2026 at 6:42 pm

    You are looking at the representation of the Fault object; the string message itself is contained in the .faultString attribute:

    print fault.faultString
    

    The __repr__ of the Fault class otherwise represents that value using repr(); you cannot get around that without changing the xmlrpclib.Fault class itself (by replacing it’s __repr__ method or adding a __str__ method to it).

    You could monkey patch that into the class:

    from xmlrpclib import Fault
    
    def fault_repr(self):
        return "<Fault %s: %s>" % (self.faultCode, self.faultString)
    
    Fault.__repr__ = fault_repr
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my server side code create an event on Facebook, using a Facebook
I have a server-side code using .NET Remoting to establish the connection with client.
I have written a server side code using Sockets, Its working fine but have
On server side I have this code which running in new thread static void
My server side code is the following (just for the sake of testing it):
Most server-side-scripting languages have an exec function ( node , php , ruby ,
I have a simple xmlrpc server setup to start a SMTP server, the code
I have a server side function that requires login. If the user is logged
The following Server-Side code works: [OperationContract] public IEnumerable<object> GetBooks() { var people = new
My server-side ASP.NET code generates a JS function (actual function, e.g. function Foo() {...}

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.