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_faulthandler test is too specific to work on Windows
Type: Stage: resolved
Components: Tests Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: python-dev, skrah, vinay.sajip, vstinner
Priority: normal Keywords: patch

Created on 2012-05-05 10:44 by vinay.sajip, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
test_faulthandler.diff vinay.sajip, 2012-05-05 10:44 Proposed small change to test regex
Messages (5)
msg159986 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2012-05-05 10:44
In test_faulthandler.test_check_fatal_error, the test expects a response which matches

"""
^Fatal Python error: {name}

{header}:
  File "<string>", line {lineno} in <module>$
""".strip()

On Windows, some more information is appended to the end of the message, so the match fails because of the trailing $. I propose to remove this $, so that the match succeeds just on the basis of the prefix.

Patch attached; I'll apply it soon, assuming you don't object.
msg159992 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2012-05-05 13:48
> On Windows, some more information is appended to the end of the message (...)

Which information? What do write these information?
msg159996 - (view) Author: Vinay Sajip (vinay.sajip) * (Python committer) Date: 2012-05-05 15:52
> Which information? What do write these information?

The Windows error message has the same beginning, but an additional

"This application has requested the Runtime to terminate it in an unusual way.\nPlease contact the application's support team for more information."

I believe this is added by Microsoft libraries - it's doesn't come from Python AFAIK.

See #9116 for a similar problem (look only at the initial report - most of the following comments go off at a tangent about preventing debugger popups).
msg160030 - (view) Author: Stefan Krah (skrah) * (Python committer) Date: 2012-05-05 19:38
Vinay's patch solves the problem. +1 for committing.
msg160070 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-05-06 10:28
New changeset 2e71f25912d4 by Vinay Sajip in branch 'default':
Closes #14729: Allowed test to pass on Windows by adjusting the test condition slightly to allow for a Windows-specific error message.
http://hg.python.org/cpython/rev/2e71f25912d4
History
Date User Action Args
2022-04-11 14:57:29adminsetgithub: 58934
2012-05-06 10:28:53python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg160070

resolution: fixed
stage: resolved
2012-05-05 19:38:27skrahsetnosy: + skrah
messages: + msg160030
2012-05-05 15:52:05vinay.sajipsetmessages: + msg159996
2012-05-05 13:48:39vstinnersetmessages: + msg159992
2012-05-05 10:44:34vinay.sajipcreate