[issue19899] No test for thread.interrupt_main()
Charlie Proctor added the comment: Found this through the "Random Issue" button -- I've uploaded a simple test case for thread.interrupt_main(). This is my first patch :) So let me know if there's something else I should do and I'd love to hear any feedback... -- keywords: +patch nosy: +charlie.proctor Added file: http://bugs.python.org/file45348/test_interrupt_main.patch ___ Python tracker <http://bugs.python.org/issue19899> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19899] No test for thread.interrupt_main()
Charlie Proctor added the comment: Thanks for the feedback David! I've posted a revised patch with more descriptive comments and the restoration code moved into addCleanup. As described in the comments, in the context of this test, the "main" thread is the one running the test suite... so rather than self.assertRaises(KeyboardInterrupt), I assert that appropriate SIGINTS are received. The lock is used to facilitate these assertions, since signals are asynchronous. -- Added file: http://bugs.python.org/file45351/test_interrupt_main.patch ___ Python tracker <http://bugs.python.org/issue19899> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19899] No test for thread.interrupt_main()
Charlie Proctor added the comment: To clarify further, the SIGALRM handler catches the timeout sent by the ITIMER_REAL... whereas the SIGINT handler catches the interrupt_main() signals. -- ___ Python tracker <http://bugs.python.org/issue19899> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19899] No test for thread.interrupt_main()
Charlie Proctor added the comment: I broke the two cases (interrupt_main from test thread and from sub-thread) into two separate tests, using an "expect_sigint" helper. Let me know what you think -- thanks! -- Added file: http://bugs.python.org/file45354/test_interrupt_main.patch ___ Python tracker <http://bugs.python.org/issue19899> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28609] argparse claims '*' positional argument is required in error output
Charlie Proctor added the comment: I agree that the message is slightly misleading. Uploading one possible solution. I'm sure someone more familiar with the library might have a better approach... -- keywords: +patch nosy: +charlie.proctor Added file: http://bugs.python.org/file45357/optional_arguments.patch ___ Python tracker <http://bugs.python.org/issue28609> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com