Author: Armin Rigo <ar...@tunes.org>
Branch: extradoc
Changeset: r5748:572cc735325d
Date: 2016-11-17 09:49 +0100
http://bitbucket.org/pypy/extradoc/changeset/572cc735325d/

Log:    Document next cpython crasher

diff --git a/planning/py3.5/cpython-crashers.rst 
b/planning/py3.5/cpython-crashers.rst
--- a/planning/py3.5/cpython-crashers.rst
+++ b/planning/py3.5/cpython-crashers.rst
@@ -41,6 +41,29 @@
   if chain=False.  This can rarely cause random nonsense in the main
   program.
 
+* setting f_lineno didn't evolve when the rest of the bytecodes evolved,
+  which means it is not safe any more::
+
+    import sys
+
+    def f():
+        try:
+            raise ValueError    # line 5
+        except ValueError:
+            print(42)           # line 7
+
+    def my_trace(*args):
+        print(args)
+        if args[1] == 'line':
+            f = args[0]
+            if f.f_lineno == 5:
+                f.f_lineno = 7
+        return my_trace
+
+    sys.settrace(my_trace)
+    f()
+    sys.settrace(None)
+
 
 Other bugs
 ----------
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to