[issue13397] Option for XMLRPC clients to automatically transform Fault exceptions into standard exceptions

2019-08-23 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
resolution:  -> rejected
stage: needs patch -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13397] Option for XMLRPC clients to automatically transform Fault exceptions into standard exceptions

2015-03-07 Thread Claudiu Popa

Changes by Claudiu Popa :


--
nosy:  -Claudiu.Popa

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13397] Option for XMLRPC clients to automatically transform Fault exceptions into standard exceptions

2013-08-25 Thread Donald Stufft

Donald Stufft added the comment:

Well you could possibly whitelist some exceptions although I still think that's 
ultimately a bad idea because it means to prevent the remote server (or someone 
in the middle of the connection) from being able to crash your program with an 
arbitrary exception it means you'd need to catch _all_ the whitelisted 
exceptions.

You could possibly make exception subclasses that subclass the Fault exception 
_and_ whatever exception the remote server threw so you could get the 
advantages of both sides.

One flaw in this though is that the remote server doesn't need to be in Python, 
so trying to map errors from the remote server into python exceptions is only 
going to work *if* the remote server is in Python (and even then only if the 
exception is a built in one and not any other exception). Yanking the text out 
of the error message and trying to turn that into an exception is fundamentally 
wrong I believe. It's a bit like reading the response body of a HTTP request 
and doing simple string searching to raise arbitrary exceptions (In fact that's 
basically exactly what it is).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13397] Option for XMLRPC clients to automatically transform Fault exceptions into standard exceptions

2013-08-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Do you have a suggestion for white-listing or a fault-to-exception mapper?

The current API makes faults difficult to use in Python.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13397] Option for XMLRPC clients to automatically transform Fault exceptions into standard exceptions

2013-08-25 Thread Donald Stufft

Donald Stufft added the comment:

-1

This essentially gives the ability for an XMLRPC server to crash any python 
code that interfaces with them unless you catch _every_ single exception 
including ones like SystemExit, KeyboardInterupt, SyntaxError, StopIteration 
etc.

An XMLRPC server is not a trusted resources and providing this option is akin 
to providing an option to unpickle arbitrary data received over the wire as 
well.

--
nosy: +dstufft

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13397] Option for XMLRPC clients to automatically transform Fault exceptions into standard exceptions

2013-08-25 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Here's a basic patch. I have two issues with it: the flag name used for 
enabling the exceptions seems too verbose (use_python_exceptions, I'm opened to 
new suggestions) and I don't know if the fallback to Fault exception if the 
remote exception is not known is the best way.

--
keywords: +patch
nosy: +Claudiu.Popa
Added file: http://bugs.python.org/file31459/xmlrpc_builtin.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13397] Option for XMLRPC clients to automatically transform Fault exceptions into standard exceptions

2011-11-19 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
stage:  -> needs patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13397] Option for XMLRPC clients to automatically transform Fault exceptions into standard exceptions

2011-11-18 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13397] Option for XMLRPC clients to automatically transform Fault exceptions into standard exceptions

2011-11-13 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +flox, loewis

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13397] Option for XMLRPC clients to automatically transform Fault exceptions into standard exceptions

2011-11-13 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
components: +Library (Lib)
priority: normal -> low

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13397] Option for XMLRPC clients to automatically transform Fault exceptions into standard exceptions

2011-11-13 Thread Raymond Hettinger

New submission from Raymond Hettinger :

Currently, an XMLRPC client communicating with a server running Python can make 
Python style calls but exceptions get collapsed into a standard FaultException 
making it difficult to program in a Pythonic style:

proxy = xmlrpc.client.ServerProxy("http://localhost:8000/";)
try:
value = proxy.lookup('somekey')
except xmlrpc.client.Fault as err:
if err.faultCode == 1 and 'KeyError' in err.faultString:
k = re.search(r":.(\w+)' not found$", err.faultString).groups(1)
raise KeyError(k)
 
It would be better if we could do this automatically (search for a pure python 
exception of the same name and raise it instead of a Fault):

proxy = xmlrpc.client.ServerProxy("http://localhost:8000/";, 
python_exceptions=True)

try:
   value = proxy.lookup('somekey')
except KeyError as e:
   ...

--
messages: 147572
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Option for XMLRPC clients to automatically transform Fault exceptions 
into standard exceptions
type: feature request
versions: Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com