[issue10762] strftime('%f') segfault
New submission from David Leonard : Installed http://www.python.org/ftp/python/2.7.1/python-2.7.1.amd64.msi on Windows 7, x64 into C:\Python27 C:\>\Python27\python.exe Python 2.7.1 (r271:86832, Nov 27 2010, 17:19:03) [MSC v.1500 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import time >>> time.strftime('%f') Dialog raises: "Python.exe has stopped working" -- components: Library (Lib) messages: 124542 nosy: dleonard0 priority: normal severity: normal status: open title: strftime('%f') segfault type: crash versions: Python 2.7 ___ Python tracker <http://bugs.python.org/issue10762> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10762] strftime('%f') segfault
David Leonard added the comment: Agree that the patches from issue 4804 and wrapping strftime() to catch the invalid_parameter call would fix this: windbg trace: 0:000> k Child-SP RetAddr Call Site `0021f328 07fe`fdbb27cf ntdll!ZwTerminateProcess+0xa `0021f330 `6ec24eec KERNELBASE!TerminateProcess+0x2f `0021f360 `6ec24fc0 MSVCR90!invoke_watson+0x11c `0021f950 `6ec11f5d MSVCR90!invalid_parameter+0x70 `0021f990 `6ec11fcd MSVCR90!Gettnames+0xebd `0021fa30 `1e062e29 MSVCR90!strftime+0x15 `0021fa70 `1e0bff79 python27!PyTime_DoubleToTimet+0x5f9 `0021fae0 `1e10f084 python27!PyCFunction_Call+0x69 `0021fb10 `1e112834 python27!PyEval_GetGlobals+0x944 `0021fb70 `1e114039 python27!PyEval_EvalFrameEx+0x36a4 `0021fc60 `1e1140d9 python27!PyEval_EvalCodeEx+0x7e9 `0021fd10 `1e1400ca python27!PyEval_EvalCode+0x29 `0021fd70 `1e1417f6 python27!PyErr_Display+0x40a `0021fda0 `1e14235e python27!PyRun_InteractiveOneFlags+0x1c6 `0021fe10 `1e1423d5 python27!PyRun_InteractiveLoopFlags+0xce `0021fe40 `1e0443d9 python27!PyRun_AnyFileExFlags+0x45 `0021fe70 `1d00119e python27!Py_Main+0x8e9 `0021ff30 `777bf56d python+0x119e `0021ff60 `779f3021 kernel32!BaseThreadInitThunk+0xd `0021ff90 ` ntdll!RtlUserThreadStart+0x21 -- ___ Python tracker <http://bugs.python.org/issue10762> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4444] unittest - use contexts to assert exceptions
New submission from David Leonard <[EMAIL PROTECTED]>: Patch to allow unit tests to test for exceptions through a 'with' statement. Resulting (failing) test would look like this: import unittest class T(unittest.TestCase): def runTest(self): with self.assertRaises(KeyError): raise ValueError This saves having to put exception raising tests into a try/except block, which is cool. And by cool I mean totally sweet. -- components: Library (Lib) files: unittest.patch keywords: patch messages: 76492 nosy: dleonard0 severity: normal status: open title: unittest - use contexts to assert exceptions type: feature request versions: Python 3.0 Added file: http://bugs.python.org/file12138/unittest.patch ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com