Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'parser': 0.07; 'logic': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python': 0.11; 'question.': 0.14; "chris'": 0.16; 'filesystem': 0.16; 'ideally,': 0.16; '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; 'responses.': 0.16; 'situation.': 0.16; 'module': 0.19; 'input': 0.22; '(in': 0.22; 'header:User-Agent:1': 0.23; '(such': 0.24; 'decide': 0.24; 'file.': 0.24; 'permission': 0.26; '(for': 0.26; 'header:X -Complaints-To:1': 0.27; 'ideal': 0.29; 'xml': 0.29; 'related': 0.29; 'exceptions': 0.31; 'writes:': 0.31; 'file': 0.32; 'case,': 0.35; 'really': 0.36; 'charset:us-ascii': 0.36; 'thanks': 0.36; 'should': 0.36; 'application': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'received:217': 0.63; 'kind': 0.63; 'more': 0.64; 'occur': 0.65; 'here': 0.66; 'reads': 0.68; 'potentially': 0.81 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: dieter Subject: Re: Exception Handling Date: Sat, 11 Apr 2015 07:39:23 +0200 References: <1cd0a97d-96c7-4ee6-9cfe-c0e90b9baa55@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Gmane-NNTP-Posting-Host: pd9e0939a.dip0.t-ipconnect.de User-Agent: Gnus/5.1008 (Gnus v5.10.8) XEmacs/21.4.22 (linux) Cancel-Lock: sha1:2QbZNwBa1RNiG6Ydo8hMsTzlxJM= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20 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: 17 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1428730779 news.xs4all.nl 2928 [2001:888:2000:d::a6]:55167 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:88803 Palpandi writes: > Thanks for your responses. And I have one more question. > This is the situation. A python application which reads data from one .xml file and generates some other file. Here what kind of exceptions occur? Ideally, you would not get any exceptions. In the not ideal case, you may get exceptions from the XML parser (in case, your XML input file is not valid), the "os" module (for permission or filesystem related problems) and potentially exceptions (such as "AttributeError") from your own program logic (in case it would be faulty). I support Chris' recommendation to not care about exceptions intially (as they are exceptions - and do not occur frequently) and decide what to do should they really occur.