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.

Author davin
Recipients BreamoreBoy, davin, jnoller, sbt, serhiy.storchaka
Date 2015-03-10.18:35:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1426012531.99.0.493113240462.issue21779@psf.upfronthosting.co.za>
In-reply-to
Content
Attaching patch for both 3.4 and default/3.5 (single file works for both) which fixes the test to properly adjust for running under -Werror.


Whether -Werror is set or otherwise the equivalent of 'warnings.simplefilter("error", Warning)' has been set, any warnings will trigger messages being sent to stderr (that's good).  This problematic test, in particular, reassigns sys.stderr to point at a file in an attempt to capture exit codes from a Process into that file (that's okay); but any warning messages sent to stderr may also end up being captured inside that same file depending upon the timings of the threads involved (that's bad).  To support the established behavior inside multiprocessing for capturing non-int exit codes (see issue13854), the test has been made more robust to detect when it is being run with -Werror (or similar) and allow for extra messages potentially appearing on stderr, otherwise it will continue to use the existing test to validate the output seen on stderr (captured in that file).

In the suite of tests for multiprocessing, test_multiprocessing_spawn currently triggers a bunch of warnings due to differences in how spawn works versus fork -- one example of this common pattern:

    test_abort (test.test_multiprocessing_spawn.WithProcessesTestBarrier) ... Exception ignored in: <_io.FileIO name='/dev/null' mode='rb' closefd=True>
    ResourceWarning: unclosed file <_io.TextIOWrapper name='/dev/null' mode='r' encoding='UTF-8'>

How to better handle the triggering of these warnings in the first place is left as a topic for consideration in the future.


This patch's updated test has been tested with and without "-Werror" against 3.4 and default/3.5 on OS X 10.10.
History
Date User Action Args
2015-03-10 18:35:32davinsetrecipients: + davin, jnoller, BreamoreBoy, sbt, serhiy.storchaka
2015-03-10 18:35:31davinsetmessageid: <1426012531.99.0.493113240462.issue21779@psf.upfronthosting.co.za>
2015-03-10 18:35:31davinlinkissue21779 messages
2015-03-10 18:35:31davincreate