[issue30953] Fatal python error when jumping into except clause

2020-09-27 Thread ppperry


Change by ppperry :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30953] Fatal python error when jumping into except clause

2020-09-25 Thread Irit Katriel


Irit Katriel  added the comment:

This seems resolved.

--
nosy: +iritkatriel

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30953] Fatal python error when jumping into except clause

2018-03-23 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 397466dfd905b5132f1c831cd9dff3ecc40b3218 by Serhiy Storchaka in 
branch 'master':
bpo-30953: Improve error messages and add tests for jumping (GH-6196)
https://github.com/python/cpython/commit/397466dfd905b5132f1c831cd9dff3ecc40b3218


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30953] Fatal python error when jumping into except clause

2018-03-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
versions: +Python 3.8 -Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30953] Fatal python error when jumping into except clause

2018-03-23 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +5943
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30953] Fatal python error when jumping into except clause

2018-03-22 Thread ppperry

ppperry  added the comment:

... with a bad error message, because there are no finally blocks in the code

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30953] Fatal python error when jumping into except clause

2018-03-22 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This is fixed in 3.8.

Traceback (most recent call last):
  File "issue30953.py", line 15, in 
error()
  File "issue30953.py", line 14, in error
pass
  File "issue30953.py", line 14, in error
pass
  File "issue30953.py", line 4, in trace
frame.f_lineno = 12
ValueError: can't jump into or out of a 'finally' block

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30953] Fatal python error when jumping into except clause

2017-07-21 Thread Xavier de Gaye

Xavier de Gaye added the comment:

issue 17288 is related.

--
nosy: +xdegaye

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30953] Fatal python error when jumping into except clause

2017-07-17 Thread Louie Lu

Louie Lu added the comment:

You will need to use `dis` to see what actually done by bytecode.


$ ./python -m dis tests.py

Disassembly of :
  9   0 SETUP_EXCEPT 4 (to 6)

 10   2 POP_BLOCK
  4 JUMP_FORWARD12 (to 18)

 11 >>6 POP_TOP
  8 POP_TOP
 10 POP_TOP

 12  12 POP_EXCEPT
 14 JUMP_FORWARD 2 (to 18)
 16 END_FINALLY

 14 >>   18 LOAD_CONST   0 (None)
 20 RETURN_VALUE


this is the actual bytecode in `error()`.

When the eval loop hit the line 9, it will perform bytecode `SETUP_EXCEPT`, 
thus push a block into the blockstack. 
Your code in trace wrote that `and frame.f_lineno > 12`, thus it will run line 
12 and perform POP_EXCEPT to pop out the blockstack.

then goto line 13, catch by trace if statement, f_lineno changed to 12, and 
perform `POP_EXCEPT` again, there isn't any block inside the blockstack, thus 
it will get a "XXX block stack underflow".

--
nosy: +louielu

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30953] Fatal python error when jumping into except clause

2017-07-17 Thread ppperry

New submission from ppperry:

trying to execute the following code:
import sys
def trace(frame, event, arg):
if event == "line" and frame.f_lineno > 12:
frame.f_lineno = 12
return None
return trace
sys.settrace(trace)
def error():
try:
pass
except:
pass
pass
pass
error()
Produces a fatal error:
Fatal Python error: XXX block stack underflow

Current thread 0x0af4 (most recent call first):
  File "jumpintoexception.py", line 12 in error
  File "jumpintoexception.py", line 15 in 

--
components: Interpreter Core, Library (Lib)
messages: 298556
nosy: ppperry
priority: normal
severity: normal
status: open
title: Fatal python error when jumping into except clause
type: crash
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com