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


Groups > comp.lang.python > #46379 > unrolled thread

Re: Fatal Python error

Started byJoshua Landau <joshua.landau.ws@gmail.com>
First post2013-05-29 15:05 +0100
Last post2013-05-31 07:31 -0700
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Fatal Python error Joshua Landau <joshua.landau.ws@gmail.com> - 2013-05-29 15:05 +0100
    Re: Fatal Python error nn <pruebauno@latinmail.com> - 2013-05-31 07:31 -0700

#46379 — Re: Fatal Python error

FromJoshua Landau <joshua.landau.ws@gmail.com>
Date2013-05-29 15:05 +0100
SubjectRe: Fatal Python error
Message-ID<mailman.2358.1369836402.3114.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

On 29 May 2013 14:02, Dave Angel <davea@davea.name> wrote:

> On 05/29/2013 08:45 AM, Oscar Benjamin wrote:
> Joshua:  Avoid doing anything complex inside an exception handler.


Unfortunately, Ranger (the file manager in question) wraps a lot of stuff
in one big exception handler. Hence there isn't much choice. The original
wasn't actually in an infinite recursion, too, but just a recursion over a
large directory.

Is there a reason that Python 3 can't be made to work like Python 2 and
PyPy, and -if not- should it? The catchable fail would be much nicer than
just bombing the program.

In the meantime the algorithm should just be reworked, but it seems like a
larger step than should be needed.

If nothing else, the exception frame is huge.  I probably would have
> spotted it except for the indentation problem triggered by html.  The top
> level code following your function didn't have any loops, so it wasn't a
> problem.
>
> Can anyone help Joshua put his gmail into text mode?


I've found a new option. As a test, here's a simplified version without the
property:

def loop():
    try:
        (lambda: None)()
    except:
        pass

    loop()

try:
    loop()
except RuntimeError:
    pass

which is pretty much Oscar Benjamin's, but less stupid.

[toc] | [next] | [standalone]


#46602

Fromnn <pruebauno@latinmail.com>
Date2013-05-31 07:31 -0700
Message-ID<25cc650c-9047-4533-bf8d-cf5b8dcf6a05@v2g2000yqa.googlegroups.com>
In reply to#46379
On May 29, 10:05 am, Joshua Landau <joshua.landau...@gmail.com> wrote:
> On 29 May 2013 14:02, Dave Angel <da...@davea.name> wrote:
>
> > On 05/29/2013 08:45 AM, Oscar Benjamin wrote:
> > Joshua:  Avoid doing anything complex inside an exception handler.
>
> Unfortunately, Ranger (the file manager in question) wraps a lot of stuff
> in one big exception handler. Hence there isn't much choice. The original
> wasn't actually in an infinite recursion, too, but just a recursion over a
> large directory.
>
> Is there a reason that Python 3 can't be made to work like Python 2 and
> PyPy, and -if not- should it? The catchable fail would be much nicer than
> just bombing the program.
>
> In the meantime the algorithm should just be reworked, but it seems like a
> larger step than should be needed.
>
> If nothing else, the exception frame is huge.  I probably would have
>
> > spotted it except for the indentation problem triggered by html.  The top
> > level code following your function didn't have any loops, so it wasn't a
> > problem.
>
> > Can anyone help Joshua put his gmail into text mode?
>
> I've found a new option. As a test, here's a simplified version without the
> property:
>
> def loop():
>     try:
>         (lambda: None)()
>     except:
>         pass
>
>     loop()
>
> try:
>     loop()
> except RuntimeError:
>     pass
>
> which is pretty much Oscar Benjamin's, but less stupid.

If nobody else has, I would recommend you submit a bug at
bugs.python.org.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web