Skip to content
This repository has been archived by the owner on Feb 6, 2019. It is now read-only.

python sys.excepthook problem, causing the actual python executable to terminate (not a python .py exception / clean exit) #24

Closed
delandtj opened this issue Aug 14, 2018 · 1 comment

Comments

@delandtj
Copy link

run under gdb isn't useful (except it shows threads being used):

(gdb) set args /usr/local/bin/js_shell
(gdb) run
Starting program: /usr/bin/python3 /usr/local/bin/js_shell
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
* ***Application started***: jsshell
[New Thread 0x7ffff30fa700 (LWP 29770)]
Python 3.6.6 (default, Jun 27 2018, 14:44:17) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.5.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: [New Thread 0x7ffff26b9700 (LWP 29772)]
[Thread 0x7ffff26b9700 (LWP 29772) exited]
[New Thread 0x7ffff26b9700 (LWP 29773)]
[Thread 0x7ffff26b9700 (LWP 29773) exited]
[New Thread 0x7ffff26b9700 (LWP 29774)]
[Thread 0x7ffff26b9700 (LWP 29774) exited]
[New Thread 0x7ffff26b9700 (LWP 29775)]
[Thread 0x7ffff26b9700 (LWP 29775) exited]
[New Thread 0x7ffff26b9700 (LWP 29781)]
[Thread 0x7ffff26b9700 (LWP 29781) exited]
j.data.schema.test()[New Thread 0x7ffff26b9700 (LWP 29782)]
[Thread 0x7ffff26b9700 (LWP 29782) exited]
[New Thread 0x7ffff26b9700 (LWP 29783)]
[Thread 0x7ffff26b9700 (LWP 29783) exited]
In [1]: j.data.schema.test()
[New Thread 0x7ffff26b9700 (LWP 29786)]
[New Thread 0x7fffe1fff700 (LWP 29787)]
[New Thread 0x7fffe17fe700 (LWP 29788)]
prop:nr                        (integer)   default:4
prop:date_start                (date)
prop:description               (string)   default:""
prop:token_price               (numeric)   default:b'\x01\x97\x00\x00\x00\x00\x00\x00$@'
prop:cost_estimate             (float)
prop:U                         (float)
prop:llist2                    (list(string))
prop:llist                     (list(string))
prop:llist3                    (list(float))   default:[1.0, 2.0, 3.0]
prop:llist4                    (list(string))   default:['1', '2', '3']
prop:llist5                    (list(integer))   default:[1, 2, 3]

[Thread 0x7fffe17fe700 (LWP 29788) exited]
[Thread 0x7fffe1fff700 (LWP 29787) exited]
[Thread 0x7ffff26b9700 (LWP 29786) exited]
$name$

Error in sys.excepthook:

Original exception was:
[Thread 0x7ffff30fa700 (LWP 29770) exited]
[Inferior 1 (process 29761) exited with code 01]
(gdb) 

without gdb:

(stretch2)root@debianuc:~# js_shell
* ***Application started***: jsshell
Python 3.6.6 (default, Jun 27 2018, 14:44:17) 
Type 'copyright', 'credits' or 'license' for more information
IPython 6.5.0 -- An enhanced Interactive Python. Type '?' for help.

In [1]: j.data.schema.test()
prop:nr                        (integer)   default:4
prop:date_start                (date)
prop:description               (string)   default:""
prop:token_price               (numeric)   default:b'\x01\x97\x00\x00\x00\x00\x00\x00$@'
prop:cost_estimate             (float)
prop:U                         (float)
prop:llist2                    (list(string))
prop:llist                     (list(string))
prop:llist3                    (list(float))   default:[1.0, 2.0, 3.0]
prop:llist4                    (list(string))   default:['1', '2', '3']
prop:llist5                    (list(integer))   default:[1, 2, 3]

$name$

Error in sys.excepthook:

Original exception was:
(stretch2)root@debianuc:~#

apparently this is a known issue, an actual bug in the python executable
pytest-dev/execnet#30

@delandtj
Copy link
Author

ok it's an interaction of python3 and bpython. this works fine:

diff --git a/DigitalMeLib/data/schema/SchemaFactory.py b/DigitalMeLib/data/schema/SchemaFactory.py
index a5e3267..81d866c 100755
--- a/DigitalMeLib/data/schema/SchemaFactory.py
+++ b/DigitalMeLib/data/schema/SchemaFactory.py
@@ -138,8 +138,8 @@ class SchemaFactory(JSBASE):
         o.token_price = "10 EUR"
         o.description = "something"
 
-        import bpython;
-        bpython.embed(locals(), banner='$name$')
+        import IPython
+        IPython.embed(header='$name$')
 
         o.cobj
 

@rkhamis rkhamis closed this as completed Sep 11, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants