Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #31240

Re: Understanding and dealing with an exception

Path csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
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; 'itself.': 0.11; 'file,': 0.15; '"right"': 0.16; 'ah,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'oct': 0.16; 'subject:exception': 0.16; 'traceback.': 0.16; 'wrote:': 0.17; 'bytes': 0.17; 'all,': 0.21; 'trying': 0.21; 'exceptions': 0.22; 'sorry,': 0.22; 'seems': 0.23; 'header:In- Reply-To:1': 0.25; 'looks': 0.26; 'question': 0.27; 'message- id:@mail.gmail.com': 0.27; 'source': 0.29; 'error': 0.30; 'primary': 0.30; 'code': 0.31; 'file': 0.32; 'could': 0.32; 'problem': 0.33; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'wrong': 0.34; 'open': 0.35; 'pm,': 0.35; 'received:209.85': 0.35; 'there': 0.35; '(i.e.': 0.36; 'anything': 0.36; 'subject:with': 0.36; 'does': 0.37; 'being': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'sure': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'think': 0.40; 'is.': 0.62; 'more': 0.63; 'confirm': 0.64
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=M/RAdGdCxt/cgfjbUd7wPIrjmn8Jfj66FB69uJEZ0iw=; b=C+a38yfprrfwej+RDIJ55V12l7pJUXLCN6cgTQeOqAlD7qHbCNYAfCU5kDtlYT4WSS uGSl4tvVLA5h3VSw+Sxkh6IcXArP1QXiAqdRNgloqUMsSQpdZT551FHm0PihYjggaj1I MSdQ4k/CkDAI7BeR98pa346QekdbfTieVdaUH8g2mQs30Rszp1/28Ev6SsvcqvbM/mGI +QQdkFPOB2mEPMfUbKwt3uzqCqaG3TCtH/zQ799p9e8DwUYz0Ij449VyW+PtDAOocTlz nq9a3HMC1lTngUFG3zqsPMhdROdlmp/XZP0AAW2tGbytYoR+5VzM+MvpF30/E6f1N11o QEnw==
MIME-Version 1.0
In-Reply-To <CALyJZZUVVXNR68FXNnuRCHAN_rRN_5O-R8bbHC7_P=NDrE78Sw@mail.gmail.com>
References <CALyJZZXtxD5HZCZ6C21-uPgxQUhvWw7xaUZsmPw-whTvhjGBsA@mail.gmail.com> <CAPTjJmo96WxHi-Y+ZbhQD3P3rBFLstn5OtOoydXZxDKpGcsjBg@mail.gmail.com> <CALyJZZUe51=Ge68X1Cnwsb4-eDGcxy3sOH9Yyzsay3h4MAOktw@mail.gmail.com> <CAPTjJmpi0-kSboeW130ineM2dO89TzQhoVVwfsURZoLCuWTUYQ@mail.gmail.com> <CALyJZZUVVXNR68FXNnuRCHAN_rRN_5O-R8bbHC7_P=NDrE78Sw@mail.gmail.com>
Date Sun, 14 Oct 2012 16:09:44 +1100
Subject Re: Understanding and dealing with an exception
From Chris Angelico <rosuav@gmail.com>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2169.1350191388.27098.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1350191388 news.xs4all.nl 6850 [2001:888:2000:d::a6]:56165
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:31240

Show key headers only | View raw


On Sun, Oct 14, 2012 at 4:01 PM, Vincent Davis <vincent@vincentdavis.net> wrote:
> I can open it is and all looks good using Pixelmator (I don't have Photoshop
> installed). I don't think there is anything wrong with the image.
>
> Part of my question is a result of being new to actually using exceptions in
> my programs and dealing with the exceptions is a primary part of what I need
> to do with this program. When I get an exception that seems to be an issue
> with PIL (i.e. not my program or a problem with the image) I am not sure
> what the "right" or conventional way to deal with it is.

Ah, okay. Sorry, I don't know PIL at all, and was just reading the
error message itself. It does seem that you're trying to read more
than 1<<31 bytes from a 1.2MB file, though you could confirm that by
looking at the source code - the file and line as in the traceback.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Understanding and dealing with an exception Chris Angelico <rosuav@gmail.com> - 2012-10-14 16:09 +1100

csiph-web