Update of /cvs-repository/Packages/ZEO/zrpc In directory cvs.zope.org:/tmp/cvs-serv17721/ZEO/zrpc
Modified Files: Tag: Zope-2_7-branch connection.py Log Message: Collector 1900. send_reply(), return_error(): Stop trying to catch an exception that doesn't exist, when marshal.encode() raises an exception. Jeremy simplified the marshal.encode() half of this about 3 years ago, but apparently forgot to change ZEO/zrpc/connection.py to match. === Packages/ZEO/zrpc/connection.py 1.49.4.5 => 1.49.4.6 === --- Packages/ZEO/zrpc/connection.py:1.49.4.5 Wed Feb 9 11:03:41 2005 +++ Packages/ZEO/zrpc/connection.py Tue Oct 4 12:20:17 2005 @@ -414,9 +414,13 @@ return hasattr(self.obj, name) def send_reply(self, msgid, ret): + # encode() can pass on a wide variety of exceptions from cPickle. + # While a bare `except` is generally poor practice, in this case + # it's acceptable -- we really do want to catch every exception + # cPickle may raise. try: msg = self.marshal.encode(msgid, 0, REPLY, ret) - except self.marshal.errors: + except: # see above try: r = short_repr(ret) except: @@ -433,9 +437,13 @@ if type(err_value) is not types.InstanceType: err_value = err_type, err_value + # encode() can pass on a wide variety of exceptions from cPickle. + # While a bare `except` is generally poor practice, in this case + # it's acceptable -- we really do want to catch every exception + # cPickle may raise. try: msg = self.marshal.encode(msgid, 0, REPLY, (err_type, err_value)) - except self.marshal.errors: + except: # see above try: r = short_repr(err_value) except: _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins