Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
vstinner opened this issue Jul 1, 2011 · 7 comments
Labels
OS-windows stdlib Python modules in the Lib dir tests Tests in the Lib/test dir type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@vstinner
Copy link
Member

vstinner commented Jul 1, 2011

BPO 12467
Nosy @pitrou, @vstinner
Files
  • warn_unicode.patch
  • test_warn_assert.py
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2011-07-04.09:21:09.951>
    created_at = <Date 2011-07-01.13:21:22.884>
    labels = ['tests', 'library', 'OS-windows', 'type-crash']
    title = 'test_threading.test_6_daemon_threads(): Assertion failed: PyUnicode_Check(*filename), file ..\\Python\\_warnings.c, line 501'
    updated_at = <Date 2011-07-04.17:54:51.882>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2011-07-04.17:54:51.882>
    actor = 'python-dev'
    assignee = 'none'
    closed = True
    closed_date = <Date 2011-07-04.09:21:09.951>
    closer = 'vstinner'
    components = ['Library (Lib)', 'Tests', 'Windows']
    creation = <Date 2011-07-01.13:21:22.884>
    creator = 'vstinner'
    dependencies = []
    files = ['22557', '22558']
    hgrepos = []
    issue_num = 12467
    keywords = ['patch']
    message_count = 7.0
    messages = ['139577', '139711', '139712', '139713', '139725', '139726', '139795']
    nosy_count = 3.0
    nosy_names = ['pitrou', 'vstinner', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'commit review'
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue12467'
    versions = ['Python 2.7', 'Python 3.2', 'Python 3.3']

    @vstinner
    Copy link
    Member Author

    vstinner commented Jul 1, 2011

    ======================================================================
    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

    @vstinner vstinner added stdlib Python modules in the Lib dir tests Tests in the Lib/test dir OS-windows labels Jul 1, 2011
    @vstinner
    Copy link
    Member Author

    vstinner commented Jul 3, 2011

    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.

    @vstinner
    Copy link
    Member Author

    vstinner commented Jul 3, 2011

    Test script to reproduce the assertion.

    @pitrou
    Copy link
    Member

    pitrou commented Jul 3, 2011

    Nice diagnosis!

    @pitrou pitrou added the type-crash A hard crash of the interpreter, possibly with a core dump label Jul 3, 2011
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 4, 2011

    New changeset ac18e70cbe7e by Victor Stinner in branch '3.2':
    Issue bpo-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 bpo-12467: warnings: fix a race condition if a warning is
    http://hg.python.org/cpython/rev/5133fee2433e

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 4, 2011

    New changeset fc46acf7a645 by Victor Stinner in branch '2.7':
    Issue bpo-12467: warnings: fix a race condition if a warning is emitted at
    http://hg.python.org/cpython/rev/fc46acf7a645

    @vstinner vstinner closed this as completed Jul 4, 2011
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 4, 2011

    New changeset 861b483e88d9 by Victor Stinner in branch '3.2':
    Issue bpo-12467: warnings: fix a race condition if a warning is emitted at
    http://hg.python.org/cpython/rev/861b483e88d9

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    OS-windows stdlib Python modules in the Lib dir tests Tests in the Lib/test dir type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants