This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_threading.test_6_daemon_threads(): Assertion failed: PyUnicode_Check(*filename), file ..\Python\_warnings.c, line 501
Type: crash Stage: commit review
Components: Library (Lib), Tests, Windows Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: pitrou, python-dev, vstinner
Priority: normal Keywords: patch

Created on 2011-07-01 13:21 by vstinner, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
warn_unicode.patch vstinner, 2011-07-03 22:46 review
test_warn_assert.py vstinner, 2011-07-03 22:50
Messages (7)
msg139577 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-07-01 13:21
======================================================================
FAIL: test_6_daemon_threads (test.test_threading.ThreadJoinOnShutdown)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\test_threading.py", line 677, in test_6_daemon_threads
    rc, out, err = assert_python_ok('-c', script)
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\script_helper.py", line 50, in assert_python_ok
    return _assert_python(True, *args, **env_vars)
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows\build\lib\test\script_helper.py", line 42, in _assert_python
    "stderr follows:\n%s" % (rc, err.decode('ascii', 'ignore')))
AssertionError: Process return code is 3, stderr follows:

Assertion failed: PyUnicode_Check(*filename), file ..\Python\_warnings.c, line 501

http://www.python.org/dev/buildbot/all/builders/x86%20XP-4%203.x/builds/4881/steps/test/logs/stdio
msg139711 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-07-03 22:46
The assertion occurs in setup_context() of Python/_warnings.c, called by fileio_dealloc_warn(). The problem is that globals()['__file__'] is None.

Attached patch should fix this issue.
msg139712 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2011-07-03 22:50
Test script to reproduce the assertion.
msg139713 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-07-03 22:51
Nice diagnosis!
msg139725 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-07-04 00:57
New changeset ac18e70cbe7e by Victor Stinner in branch '3.2':
Issue #12467: warnings: fix a race condition if a warning is emitted at
http://hg.python.org/cpython/rev/ac18e70cbe7e

New changeset 5133fee2433e by Victor Stinner in branch 'default':
(merge 3.2) Issue #12467: warnings: fix a race condition if a warning is
http://hg.python.org/cpython/rev/5133fee2433e
msg139726 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-07-04 01:05
New changeset fc46acf7a645 by Victor Stinner in branch '2.7':
Issue #12467: warnings: fix a race condition if a warning is emitted at
http://hg.python.org/cpython/rev/fc46acf7a645
msg139795 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-07-04 17:54
New changeset 861b483e88d9 by Victor Stinner in branch '3.2':
Issue #12467: warnings: fix a race condition if a warning is emitted at
http://hg.python.org/cpython/rev/861b483e88d9
History
Date User Action Args
2022-04-11 14:57:19adminsetgithub: 56676
2011-07-04 17:54:51python-devsetmessages: + msg139795
2011-07-04 09:21:09vstinnersetstatus: open -> closed
resolution: fixed
2011-07-04 01:05:46python-devsetmessages: + msg139726
2011-07-04 00:57:06python-devsetnosy: + python-dev
messages: + msg139725
2011-07-03 22:51:56pitrousettype: crash
2011-07-03 22:51:29pitrousetmessages: + msg139713
stage: commit review
2011-07-03 22:50:39vstinnersetfiles: + test_warn_assert.py

messages: + msg139712
2011-07-03 22:46:57vstinnersetfiles: + warn_unicode.patch
versions: + Python 2.7, Python 3.2
nosy: + pitrou

messages: + msg139711

keywords: + patch
2011-07-01 13:21:22vstinnercreate