[issue26693] Exception exceptions.AttributeError '_shutdown' in
New submission from skydoom: I did a search and find the issue 1947, however it's set to "not a bug". In its last note, it's suggested a 'packaging/environment issue'. But since I can reliably reproduce the issue with the "official python package"(that installed by the system, such as I am not building the python from source), Also, the same issue does not occurred on python 2.6.2, but 3.4.3 and 3.5.1. Even though it seems the "AssertionError" message is non-harmful but it's still a bit annoying. I am wondering if you can take a look my issue? Please compile the attached source codes to reproduce my issue. Note that it only occurred when we (explicitly or implicitly) import the 'threading' module. If we comment out that line, it works fine. -- components: Library (Lib) files: test2.C messages: 262884 nosy: skydoom priority: normal severity: normal status: open title: Exception exceptions.AttributeError '_shutdown' in type: behavior versions: Python 3.4, Python 3.5 Added file: http://bugs.python.org/file42368/test2.C ___ Python tracker <http://bugs.python.org/issue26693> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26693] Exception exceptions.AttributeError '_shutdown' in
skydoom added the comment: This is how I compile my code: CFLAG is obtained from `python3.5m-config --includes` LDFLAG is obtained from `"python-3.5m-config --ldflags` g++ ${CFLAG} ${LDFLAG} test2.C I am running on Linux. -- ___ Python tracker <http://bugs.python.org/issue26693> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26693] Exception exceptions.AttributeError '_shutdown' in
skydoom added the comment: I print out the threading.__file__ and can see it's "${PYTHONHOME}/lib/python3.5/threading.py" . I don't have any other "threading.py" elsewhere. so what should I do? -- ___ Python tracker <http://bugs.python.org/issue26693> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26693] Exception exceptions.AttributeError '_shutdown' in
skydoom added the comment: sorry Martin, you are right, my original title was simply (and wrongly) copied over from the issue 1947. You get my identical error message in your post. -- ___ Python tracker <http://bugs.python.org/issue26693> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26693] Exception ignored in: in _shutdown, assert tlock.locked()
skydoom added the comment: I just update the title to be precise. Exception ignored in: in _shutdown, assert tlock.locked() AssertionError: -- title: Exception exceptions.AttributeError '_shutdown' in -> Exception ignored in: in _shutdown, assert tlock.locked() ___ Python tracker <http://bugs.python.org/issue26693> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26693] Exception ignored in: in _shutdown, assert tlock.locked()
skydoom added the comment: I quote the "issue 1947" just because I did a search in the db before I file this issue and find its output is similar to what I see, (except that it has "AttributeError" which mine does not have.) and because it's filed for 2.5 and I am not sure if this is just some minor "wording changes". I tend to believe my issue is not the same issue with 1947 now. -- ___ Python tracker <http://bugs.python.org/issue26693> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26693] Exception ignored in: in _shutdown, assert tlock.locked()
skydoom added the comment: It looks like there is a bug in the _shutdown function of threading.py, that it does not check whether the _main_thread.is_alive() or not. My temporary fix is to add the following checking in the beginning of _shutdown and it seems no more error message pop up: if( _main_thread.is_active() is False ): return Please see if this makes sense. -- ___ Python tracker <http://bugs.python.org/issue26693> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26693] Exception ignored in: in _shutdown, assert tlock.locked()
skydoom added the comment: sorry typo above, is_active should be read as is_alive. -- ___ Python tracker <http://bugs.python.org/issue26693> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26693] Exception ignored in: in _shutdown, assert tlock.locked()
Changes by skydoom : -- nosy: +pitrou ___ Python tracker <http://bugs.python.org/issue26693> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26693] Exception ignored in: in _shutdown, assert tlock.locked()
skydoom added the comment: Hi Pitrou, would you be able to look at my issue and the proposed pathc? Thanks -- ___ Python tracker <http://bugs.python.org/issue26693> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26693] Exception ignored in: in _shutdown, assert tlock.locked()
skydoom added the comment: seems we also need to check whether _main_thread is daemon thread or not, so the proposed patch would look like: def _shutdown(): # add these checking first if( _main_thread.isDaemon() is False or _main_thread.is_alive() is False ): return -- ___ Python tracker <http://bugs.python.org/issue26693> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com