473,396 Members | 1,864 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Problem patching SimpleXMLRPCServer.py

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
SimpleXMLRPCServer.patch reside i run :
patch -i SimpleXMLRPCServer.patch -b --verbose --dry-run
SimpleXMLRPCServer.py
and i get :
Hmm...patch: **** unexpected end of hunk at line 47

The SimpleXMLRPCServer.patch file at lines 24-48 reads like :
--- 107,128 ----
import types
import os

! def resolve_dotted_attribute(obj, attr, allow_dotted_names=True):
"""resolve_dotted_attribute(a, 'b.c.d') => a.b.c.d

Resolves a dotted attribute name to an object. Raises
an AttributeError if any attribute in the chain starts with a '_'.
+
+ If the optional allow_dotted_names argument is false, dots are not
+ supported and this function operates similar to getattr(obj, attr).
"""

! if allow_dotted_names:
! attrs = attr.split('.')
! else:
! attrs = [attr]
!
! for i in attrs:
if i.startswith('_'):
raise AttributeError(
'attempt to access private attribute "%s"' % i
***************
*** 156,162 ****

The SimpleXMLRPCServer.py at lines 107-128 reads like :
import types
import os

def resolve_dotted_attribute(obj, attr):
"""resolve_dotted_attribute(a, 'b.c.d') => a.b.c.d

Resolves a dotted attribute name to an object. Raises
an AttributeError if any attribute in the chain starts with a '_'.
"""

for i in attr.split('.'):
if i.startswith('_'):
raise AttributeError(
'attempt to access private attribute "%s"' % i
)
else:
obj = getattr(obj,i)
return obj

def list_public_methods(obj):
"""Returns a list of attribute strings, found in the specified
object, which represent callable attributes"""

i am trying to understand what is wrong, trying to change 107-128 to 107-125
but it doesn't seem to work...

any solution or explanation would be helpfull
Thomas G. Apostolou

Dec 6 '05 #1
0 1168

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

Similar topics

2
by: Marco Aschwanden | last post by:
I would like to develop a server based on python's xmlrpc. But I realized that SimpleXMLRPCServer does not spawn a thread for each request. How could the SimpleXMLRPCServer be turned into a...
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))...
4
by: codecraig | last post by:
Hi, I thought I posted this, but its been about 10min and hasnt shown up on the group. Basically I created a SimpleXMLRPCServer and when one of its methods gets called and it returns a response...
0
by: Jeremy Monnet | last post by:
Hello, I've started python a few weeks ago, and to now everything went fine with my cookbook and a learning book. Now, I've tried the SimpleXMLRPCServer, and it worked OK untill I tried to...
5
by: Eric Smith | last post by:
I'm trying to use Python 2.4.3 and pywin32-209 to access a MySQL database on Windows Server 2003 Standard Edition, and not having much luck. It seems like parts of the MySQLdb module are not...
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...
1
by: Jan Danielsson | last post by:
Hello all, I writing an application based on the SimpleXMLRPCServer class. I would like to know the IP address of the client performing the RPC. Is that possible, without having to abandon the...
0
by: Jan Danielsson | last post by:
Hello all, I want to be able to determine the IP address of the client making an XMPRPC call. I got the tip to use this: ------------------------------- class RPCServer(SimpleXMLRPCServer):...
9
by: Bret | last post by:
I'm coming back to Python after an absence and it's surprising how many things I've forgotten since wandering (against my will) into Java land. Anyway, I have a need for a way to make...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.