Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'exception': 0.03; 'pil': 0.07; 'thrown': 0.09; 'bad;': 0.16; "file's": 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'inclined': 0.16; 'oct': 0.16; 'subject:exception': 0.16; 'wrote:': 0.17; 'tracker': 0.20; 'file.': 0.20; "i'd": 0.22; 'header:In-Reply-To:1': 0.25; 'message-id:@mail.gmail.com': 0.27; 'things,': 0.29; 'probably': 0.29; 'maybe': 0.29; 'file': 0.32; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85': 0.35; 'there': 0.35; 'but': 0.36; 'subject:with': 0.36; 'bad': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'ranges': 0.71 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=9NCxehaX+1ozlhc5YzpXM8qmt8G3cDX4rXKWEnAu6HU=; b=PesJDn+4/U9uKcT5+zdtiso7OYM3igktAtWTseEK4nFWM8CEy7VxgCcfD/YRQbpjHr HEDqOw7oiFzQdjOa8NspmnkVCrwlFCP8bxQDqkFMuBvu74IljpQPGVir380TRkKZyd1B uIvbyNMYS0V9lg5O7kNXwobj7K9AjYlb1qHhsEUGL3b7XA0ymWW+FFs4tDeEDx/y4y8a CUbjVu4rKFo0/CyvmJ6nJWJTRyR8nF5wDIjuprNqxdR5OHIf+MCB6QTX3aJkLvgLZ53o lLXabyY4Tn7XPv1YXaZgwMO9MOSpstE0im9p0Vxg09KlosLyiggNAxK3efismFSaYbrY bzew== MIME-Version: 1.0 In-Reply-To: References: Date: Sun, 14 Oct 2012 15:49:36 +1100 Subject: Re: Understanding and dealing with an exception From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 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: 11 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1350190179 news.xs4all.nl 6907 [2001:888:2000:d::a6]:46589 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:31239 On Sun, Oct 14, 2012 at 3:36 PM, Vincent Davis wrote: > Oops, I was going to make note of the file size. 1.2MB Then I'd definitely declare the file bad; I don't know what the valid ranges for channels and ysize are, but my reading of that is that your file's completely corrupt, maybe even malicious. PIL probably ought to check these things, so there may be a tracker issue coming from this, but I'd be inclined to declare any thrown exception as meaning it's a bad file. Call it "failed a security check" perhaps. ChrisA