Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #46371
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <marcelgmr@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.000 |
| X-Spam-Evidence | '*H*': 1.00; '*S*': 0.00; 'subject:error': 0.03; 'interpreter': 0.05; 'that?': 0.05; 'subject:Python': 0.06; 'error:': 0.07; 'level,': 0.07; 'pypy': 0.07; 'except:': 0.09; 'overflow': 0.09; 'try:': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'def': 0.12; '@property': 0.16; 'expect,': 0.16; 'occurs.': 0.16; 'pypy.': 0.16; 'spit': 0.16; 'valueerror,': 0.16; 'exception': 0.16; 'weird': 0.16; 'code.': 0.18; 'all,': 0.19; 'bit': 0.19; 'stack': 0.19; 'meant': 0.20; 'seems': 0.21; 'code,': 0.22; 'email addr:gmail.com>': 0.22; 'cc:addr:python.org': 0.22; 'error': 0.23; 'cc:2**0': 0.24; "i've": 0.25; 'handling': 0.26; 'pass': 0.26; 'code:': 0.26; 'defined': 0.27; 'header:In- Reply-To:1': 0.27; 'tried': 0.27; 'function': 0.29; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'url:mailman': 0.30; 'code': 0.31; 'exceptions': 0.31; 'informative': 0.31; 'python2.7': 0.31; 'class': 0.32; 'url:python': 0.33; 'core': 0.34; 'except': 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'url:listinfo': 0.36; 'similar': 0.36; 'url:org': 0.36; 'level': 0.37; 'handle': 0.38; 'little': 0.38; 'expect': 0.39; 'does': 0.39; 'itself': 0.39; 'url:mail': 0.40; 'skip:u 10': 0.60; 'lower': 0.61; 'to:addr:gmail.com': 0.65; 'statement,': 0.68; 'caused': 0.69; '3.3.1': 0.84; 'prefers': 0.84; 'disturb': 0.91; 'recover': 0.91 |
| 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 :cc:content-type; bh=XoJHPeXtav4xLzGn/TtRwSbiAm1u43IXt7H3Ba0th/0=; b=Qm1Moz2FH2zCHZmYmIMDjzzACIDILhsluShOfXaZdycr3r50raSfkqJ//JMQzAqclO 5Lap+SW/R/ri+7vX/8sDQcemR0G/3/ocP8n7j2/WDmqAAmJ3JQWeztwUT5YJmiXXE/on NXBkeiVOJaiTwesgBtseZurBtUugCiWLkEluR9APc5HrqBvMueZ8umzZ3F2CgzQa2Lu/ lAfsjSZoc2LlyWuFE0NHKRcv7HXnQvemYFPnXHK3UJfXH9yVuVFj91iMsTs6Aq9yvH/A 1s3VmucoOJAx/QWjk8PzrhZE3l7UcN9hwRGGucaK9XQmotWO7ZovJ1tNWZ7gaf+cJ6ot trEg== |
| MIME-Version | 1.0 |
| X-Received | by 10.182.129.230 with SMTP id nz6mr1418715obb.49.1369830658782; Wed, 29 May 2013 05:30:58 -0700 (PDT) |
| In-Reply-To | <CAN1F8qXPEM4B=2e7KOhWeTKzxmeeb_w_S97wYiHCMXH3jfzL6g@mail.gmail.com> |
| References | <CAN1F8qXPEM4B=2e7KOhWeTKzxmeeb_w_S97wYiHCMXH3jfzL6g@mail.gmail.com> |
| Date | Wed, 29 May 2013 09:30:58 -0300 |
| Subject | Re: Fatal Python error |
| From | Marcel Rodrigues <marcelgmr@gmail.com> |
| To | Joshua Landau <joshua.landau.ws@gmail.com> |
| Content-Type | multipart/alternative; boundary=089e0149d27cd1bd4404ddda8dfe |
| Cc | python-list <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 <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.2351.1369830668.3114.python-list@python.org> (permalink) |
| Lines | 114 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1369830668 news.xs4all.nl 15890 [2001:888:2000:d::a6]:43920 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:46371 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
I just tried your code with similar results: it does nothing on PyPy 2.0.0-beta2 and Python 2.7.4. But on Python 3.3.1 it caused core dump. It's a little weird but so is the code. You have defined a function that calls itself unconditionally. This will cause a stack overflow, which is a RuntimeError. Since you are handling this very exception with a pass statement, we would expect that no error occurs. But the fatal error message seems pretty informative at this point: "Cannot recover from stack overflow.". One thing to note is that while it's reasonable to handle exceptions that happens at the level of your Python code, like a ValueError, it's not so reasonable to try to handle something that may disturb the interpreter itself in a lower level, like a stack overflow (I think that the stack used by your code is the same stack used by the interpreter code, but I'm not sure). 2013/5/29 Joshua Landau <joshua.landau.ws@gmail.com> > Hello all, again. Instead of revising like I'm meant to be, I've been > delving into a bit of Python and I've come up with this code: > > class ClassWithProperty: > @property > def property(self): > pass > > thingwithproperty = ClassWithProperty() > > def loop(): > try: > thingwithproperty.property > except: > pass > > loop() > > try: > loop() > except RuntimeError: > pass > > As you will expect, this does nothing... on Python2.7 and PyPy. Python3.3 > prefers to spit out a "Fatal Python error: Cannot recover from stack > overflow.", which seems a bit unexpected. > > Wuzzup with that? > > -- > http://mail.python.org/mailman/listinfo/python-list > >
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Fatal Python error Marcel Rodrigues <marcelgmr@gmail.com> - 2013-05-29 09:30 -0300
csiph-web