Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feed.xsnews.nl!border-2.ams.xsnews.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'exception': 0.03; 'method.': 0.05; 'defines': 0.07; 'override': 0.07; 'subject:Why': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; ';-)': 0.11; 'subject:not': 0.11; 'right:': 0.16; 'subject:exception': 0.16; 'wrote:': 0.17; 'wednesday,': 0.22; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'skip:" 20': 0.26; 'interface': 0.27; 'methods.': 0.29; 'pickle': 0.29; 'trigger': 0.29; 'manual': 0.29; 'skip:_ 10': 0.29; 'subject: ?': 0.30; 'received:google.com': 0.34; 'thanks': 0.34; 'received:209.85': 0.35; 'there': 0.35; 'received:209': 0.37; 'subject:: ': 0.38; 'object': 0.38; 'several': 0.39; 'your': 0.60; 'more': 0.63; 'reply': 0.66; 'carefully': 0.71 Newsgroups: comp.lang.python Date: Wed, 5 Sep 2012 01:54:21 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=31.35.138.175; posting-account=qQa_BAoAAAB6AF_SqtOQYran4yaGpqxv References: <7bb72fb5-5ab5-4748-acbf-c8e7666ee834@googlegroups.com> User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 31.35.138.175 MIME-Version: 1.0 Subject: Re: Why derivated exception can not be pickled ? From: Mathieu Courtois To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1346835264 news.xs4all.nl 6963 [2001:888:2000:d::a6]:54581 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:28469 Thanks for your reply On Wednesday, September 5, 2012 8:02:55 AM UTC+2, Dieter Maurer wrote: > > The pickle interface is actually more complex and there are several > > ways an object can ensure picklability. For example, there is > > also a "__reduce__" method. I suppose, that "Exception" defines methods > > which trigger the use of an alternative picklability approach (different > > from "__getstate__/__setstate__"). You're right: Exception has __reduce__ & __reduce_ex__ methods. Always read carefully the manual ;-) I must override these methods. MC