Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1503

Show
Ignore:
Timestamp:
12/09/06 18:02:49
Author:
fumanchu
Message:

2.x fix for #533. CP3 will behave correctly and return a Fault when an XML-RPC method is not found.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/cherrypy-2.x/cherrypy/filters/xmlrpcfilter.py

    r1027 r1503  
    176176                # Try again with the new path 
    177177                path = x.path 
     178            except cherrypy.NotFound: 
     179                # http://www.cherrypy.org/ticket/533 
     180                # if a method is not found, an xmlrpclib.Fault should be returned 
     181                # raising an exception here will do that; see 
     182                # cherrypy.lib.xmlrpc.on_error 
     183                raise Exception('method "%s" is not supported' 
     184                                % cherrypy.request.rpcMethod) 
    178185         
    179186        # See xmlrpclib documentation 
  • branches/cherrypy-2.x/cherrypy/test/test_xmlrpc_filter.py

    r1017 r1503  
    9797        else: 
    9898            self.fail("Expected xmlrpclib.Fault") 
     99         
     100        # http://www.cherrypy.org/ticket/533 
     101        # if a method is not found, an xmlrpclib.Fault should be raised 
     102        try: 
     103            proxy.non_method() 
     104        except Exception, x: 
     105            self.assertEqual(x.__class__, xmlrpclib.Fault) 
     106            self.assertEqual(x.faultString, 'method "non_method" is not supported') 
     107        else: 
     108            self.fail("Expected xmlrpclib.Fault") 
    99109 
    100110 

Hosted by WebFaction

Log in as guest/cpguest to create tickets