Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!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.021 X-Spam-Evidence: '*H*': 0.96; '*S*': 0.00; 'debugging': 0.07; 'correct,': 0.09; 'happens.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:80.91.229.3': 0.16; 'received:dip0.t-ipconnect.de': 0.16; 'received:plane.gmane.org': 0.16; 'received:t-ipconnect.de': 0.16; 'segment': 0.16; 'subject:Problem': 0.16; 'subject:program': 0.16; 'essential': 0.16; 'thursday,': 0.16; 'wrote:': 0.18; 'split': 0.19; 'header :User-Agent:1': 0.23; 'header:X-Complaints-To:1': 0.27; 'tried': 0.27; 'point': 0.28; 'correct': 0.29; '(this': 0.29; 'related': 0.29; 'that.': 0.31; 'writes:': 0.31; 'figure': 0.32; 'could': 0.34; 'subject:with': 0.35; 'there': 0.35; 'i.e.': 0.36; 'doing': 0.36; 'charset:us-ascii': 0.36; 'wrong': 0.37; 'thank': 0.38; 'to:addr:python-list': 0.38; 'expect': 0.39; 'does': 0.39; '(from': 0.39; 'bad': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'march': 0.61; 'first': 0.61; 'you.': 0.62; 'complete': 0.62; 'received:217': 0.63; 'became': 0.64; 'strategy': 0.64; 'peace': 0.65; 'determine': 0.67; '20,': 0.68; 'detail.': 0.68; 'restores': 0.84; 'hand,': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: dieter Subject: Re: Problem with pickle and restarting a program Date: Sat, 22 Mar 2014 08:20:05 +0100 References: <11a691c7-2842-4d3a-b355-1e44652d7590@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gmane-NNTP-Posting-Host: pd9e08b3e.dip0.t-ipconnect.de User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux) Cancel-Lock: sha1:/KYYfrV/RUDZcEQ5lt+Ic+3dKDc= 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: , Newsgroups: comp.lang.python Message-ID: Lines: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1395472819 news.xs4all.nl 2877 [2001:888:2000:d::a6]:37334 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:68753 peace writes: > On Thursday, March 20, 2014 1:20:03 AM UTC-7, dieter wrote: > ... >> You may want to use debugging to determine what goes on in detail. > ... > I tried doing that. I still could not figure out what was wrong. Thank you. Debugging is often not easy. An essential strategy is "divide and conquer": i.e. you split the complete scenario into segments and analyse each segment to find out where the bad thing happens. Related to pickle, there is one point to lock at closely: where you "dump" the data. Verify, that you are dumping the correct (expected) data. If the data is not as you expect at that point, you must analyse the first part (from where the data was produced up to the dumping point); on the other hand, if the dumped data is correct, you would verify that "load" restores this same data (this will be very likely the case) and if it does why it became wrong afterward.