472,668 Members | 1,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

simplexmlrpcserver and allow_none


Hello,

I ran in the same problem again. Many others have the same problem. Just
Google for this: "SimpleXMLRPCServer allow_none site:python.org".
Looks like the 'allow_none' patch was commited to trunk on 2005 Dec (
http://mail.python.org/pipermail/pyt...er/048289.html )

I just upgraded to Python 2.4.3 (it was released on March 29, 2006) and
SimpleXMLRPCServer.py still has the old code.
I can work around this by coping the whole file into a new file and
patch it, but I hate to do that.
I wonder why it has not been commited to the standard library yet. Does
anyone know if it will be in the next bugfix release?

Thanks,

Laszlo

Jun 8 '06 #1
2 3072
Laszlo Nagy <ga*****@designaproduct.biz> wrote:
I ran in the same problem again. Many others have the same problem. Just
Google for this: "SimpleXMLRPCServer allow_none site:python.org".
Looks like the 'allow_none' patch was commited to trunk on 2005 Dec (
http://mail.python.org/pipermail/pyt...er/048289.html ) I just upgraded to Python 2.4.3 (it was released on March 29, 2006) and
SimpleXMLRPCServer.py still has the old code.
I can work around this by coping the whole file into a new file and
patch it, but I hate to do that.
I wonder why it has not been commited to the standard library yet. Does
anyone know if it will be in the next bugfix release?


Fredrik has already answered your specific question, but while
waiting for 2.5, another way to work around it is to do:

import xmlrpclib
# WARNING: Dirty hack below.
# Replace the dumps() function in xmlrpclib with one that by default
# handles None, so SimpleXMLRPCServer can return None.
class _xmldumps(object):
def __init__(self, dumps):
self.__dumps = (dumps,)
def __call__(self, *args, **kwargs):
kwargs.setdefault('allow_none', 1)
return self.__dumps[0](*args, **kwargs)
xmlrpclib.dumps = _xmldumps(xmlrpclib.dumps)

import SimpleXMLRPCServer
--
Thomas Bellman, Lysator Computer Club, Linköping University, Sweden
"This isn't right. This isn't even wrong." ! bellman @ lysator.liu.se
-- Wolfgang Pauli ! Make Love -- Nicht Wahr!
Jun 8 '06 #2
Thomas Bellman írta:
Laszlo Nagy <ga*****@designaproduct.biz> wrote:

I ran in the same problem again. Many others have the same problem. Just
Google for this: "SimpleXMLRPCServer allow_none site:python.org".
Looks like the 'allow_none' patch was commited to trunk on 2005 Dec (
http://mail.python.org/pipermail/pyt...er/048289.html )


I just upgraded to Python 2.4.3 (it was released on March 29, 2006) and
SimpleXMLRPCServer.py still has the old code.
I can work around this by coping the whole file into a new file and
patch it, but I hate to do that.
I wonder why it has not been commited to the standard library yet. Does
anyone know if it will be in the next bugfix release?


Fredrik has already answered your specific question, but while
waiting for 2.5, another way to work around it is to do:

import xmlrpclib
# WARNING: Dirty hack below.
# Replace the dumps() function in xmlrpclib with one that by default
# handles None, so SimpleXMLRPCServer can return None.
class _xmldumps(object):
def __init__(self, dumps):
self.__dumps = (dumps,)
def __call__(self, *args, **kwargs):
kwargs.setdefault('allow_none', 1)
return self.__dumps[0](*args, **kwargs)
xmlrpclib.dumps = _xmldumps(xmlrpclib.dumps)

import SimpleXMLRPCServer

Thank you. :-)
I already copied out SimpleXMLRPCServer.py from the 2.5 trunk and it
seems to be working, but this is much sorter.

Laszlo

Jun 8 '06 #3

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

Similar topics

3
by: Maxim Khesin | last post by:
Hi, the typical usage of SimpleXMLRPCServer registers some class with the server instance and then jumps into a serve-forever loop, e.g. server = SimpleXMLRPCServer(('', 8000))...
0
by: Thomas G. Apostolou | last post by:
Hello all, I use Python 2.3.3 and try to patch SimpleXMLRPCServer.py with the patch i got from Python.org. so after changing to the directory where both SimpleXMLRPCServer.py and...
3
by: Daniel Crespo | last post by:
Hello, Does anyone know which methods do I have to override for allowing Nones to be accepted and sended from SimpleXMLRPCServer to the client? Thanks Daniel
0
by: JDF | last post by:
I am trying to create a Windows service using SimpleXMLRPCServer and win32serviceutil. The service itself seems to be working properly (starts, stops, etc) and I can connect using an XMLRPC client...
0
by: Juju | last post by:
Hi, First, sorry for my poor English ! I used the SimpleXMLRPCServer facility of Python to develop a multithread-server, here's part of my code : -- class...
3
by: Achim Domma | last post by:
Hi, is SimpleXMLRPCServer multithreaded or how does it handle multiple clients? I want to implement a simple server which will be queried by multiple processes for work to be done. The server...
6
by: gregpinero | last post by:
I have a pretty simple XMLRPCServer, something along the lines of the example: server = SimpleXMLRPCServer(("localhost", 8000)) server.register_function(pow) server.register_function(lambda...
3
by: Sean DiZazzo | last post by:
Why is the following not working? Is there any way to get keyword arguments working with exposed XMLRPC functions? ~~~~~~~~~~~~~~~~ server.py import SocketServer from SimpleXMLRPCServer import...
4
by: mh | last post by:
My SimpleXMLRPCServer program prints to stderr a line like this for each request: ohm..pixar.com - - "POST /RPC2 HTTP/1.0" 200 - Is there a way to turn this logging off? I have RTFM and...
0
by: cloudgo | last post by:
1. Define a Clear Vision and Strategy Before embarking on a digital transformation journey, it's crucial to have a clear vision of what you want to achieve and develop a comprehensive strategy....
0
by: antdb | last post by:
Overview The node types of AntDB cluster are gtmcoord (master and slave), coordinator, datanode (master and slave). ADBMGR is the cluster management node of AntDB, users can use this node to...
0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
by: Rina0 | last post by:
Hello everyone, I recently went through a Java Interview Questions resources and encountered a couple of queries for which I'm seeking answers and suggestions. Query 1: During the interview, I...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: justzikle | last post by:
Hi all. I have an application running on windows machine. I am using Windows 10 on my desk. Wanted to configure a remote notification setup. I mean if any service or hardware encountered a problem on...
0
by: justzikle | last post by:
Is there any free of cost software that can send a SMS or email to some destination if the computer any service gets crashed?
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
1
by: CRAZImat | last post by:
Received the following error when clicking the command button to send the form in XLS format to recipients: "The expression On Click you entered as the event property setting produced the...

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.