Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue31416

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:assertion failures in warn_explicit() in case of a bad warnings.filters or warnings.defaultaction
Type:crashStage:resolved
Components:Extension ModulesVersions:Python 3.7
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: Oren Milman, serhiy.storchaka
Priority:normalKeywords:patch

Created on2017-09-11 07:52 byOren Milman, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Pull Requests
URLStatusLinkedEdit
PR 3496mergedOren Milman,2017-09-11 10:49
PR 3509mergedserhiy.storchaka,2017-09-12 06:32
Messages (3)
msg301867 -(view)Author: Oren Milman (Oren Milman)*Date: 2017-09-11 07:52
The following code causes an assertion failure in warn_explicit() (inPython/_warnings.c):import warningswarnings.filters = [(None, None, Warning, None, 0)]warnings.warn_explicit(message='foo', category=Warning, filename='bar',                       lineno=1)this is because warn_explicit() assumes that get_filter() returned a string,and passes the return value (of get_filter()) to _PyUnicode_EqualToASCIIString(),which asserts it received a string.In addition, get_filter() might return warnings.defaultaction, and so thefollowing code also causes an assertion failure in warn_explicit():import warningswarnings.defaultaction = Nonewarnings.filters = []warnings.warn_explicit(message='foo', category=Warning, filename='bar',                       lineno=1)
msg301903 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2017-09-11 21:18
New changeset9d984fd2b097c8c29479d1c3eb740995fe1ccb0d by Serhiy Storchaka (Oren Milman) in branch 'master':bpo-31416: Fix assertion failures in case of a bad warnings.filters or warnings.defaultaction. (#3496)https://github.com/python/cpython/commit/9d984fd2b097c8c29479d1c3eb740995fe1ccb0d
msg301940 -(view)Author: Serhiy Storchaka (serhiy.storchaka)*(Python committer)Date: 2017-09-12 06:48
New changeset9adc87b0f82e5169c5f44739f89212a86013d1c4 by Serhiy Storchaka in branch '3.6':[3.6]bpo-31416: Fix assertion failures in case of a bad warnings.filters or warnings.defaultaction. (GH-3496) (#3509)https://github.com/python/cpython/commit/9adc87b0f82e5169c5f44739f89212a86013d1c4
History
DateUserActionArgs
2022-04-11 14:58:52adminsetgithub: 75597
2017-09-12 06:48:53serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2017-09-12 06:48:30serhiy.storchakasetmessages: +msg301940
2017-09-12 06:32:41serhiy.storchakasetpull_requests: +pull_request3504
2017-09-11 21:18:11serhiy.storchakasetnosy: +serhiy.storchaka
messages: +msg301903
2017-09-11 10:49:09Oren Milmansetkeywords: +patch
stage: patch review
pull_requests: +pull_request3489
2017-09-11 07:52:58Oren Milmancreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp