[Python-checkins] r83067 - python/branches/py3k/Lib/test/test_subprocess.py

ronald.oussoren python-checkins at python.org
Fri Jul 23 11:50:05 CEST 2010


Author: ronald.oussoren
Date: Fri Jul 23 11:50:05 2010
New Revision: 83067

Log:
Workaround for issue 4047: in some configurations of
the Crash Reporter on OSX test_subprocess will trigger
the reporter. 

This patch prints a warning when the Crash Reporter will
get triggered intentionally, which should avoid confusing
people.


Modified:
   python/branches/py3k/Lib/test/test_subprocess.py

Modified: python/branches/py3k/Lib/test/test_subprocess.py
==============================================================================
--- python/branches/py3k/Lib/test/test_subprocess.py	(original)
+++ python/branches/py3k/Lib/test/test_subprocess.py	Fri Jul 23 11:50:05 2010
@@ -559,6 +559,21 @@
         except (ImportError, ValueError, resource.error):
             pass
 
+        if sys.platform == 'darwin':
+            # Check if the 'Crash Reporter' on OSX was configured
+            # in 'Developer' mode and warn that it will get triggered
+            # when it is.
+            #
+            # This assumes that this context manager is used in tests
+            # that might trigger the next manager.
+            value = subprocess.Popen(['/usr/bin/defaults', 'read',
+                    'com.apple.CrashReporter', 'DialogType'],
+                    stdout=subprocess.PIPE).communicate()[0]
+            if value.strip() == b'developer':
+                print("this tests triggers the Crash Reporter, "
+                      "that is intentional", end='')
+                sys.stdout.flush()
+
     def __exit__(self, *args):
         """Return core file behavior to default."""
         if self.old_limit is None:


More information about the Python-checkins mailing list