From: Victor Stinner Date: Tue, 15 Mar 2011 00:03:36 +0000 (-0400) Subject: Issue #3080: skip test_bdist_rpm if sys.executable is not encodable to UTF-8 X-Git-Tag: v3.3.0a1~2847 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=22a8cbe8af8a50aa9c60e50af0ea2e0fe934be06;p=python Issue #3080: skip test_bdist_rpm if sys.executable is not encodable to UTF-8 --- diff --git a/Lib/distutils/tests/test_bdist_rpm.py b/Lib/distutils/tests/test_bdist_rpm.py index 804fb1355f..030933f17c 100644 --- a/Lib/distutils/tests/test_bdist_rpm.py +++ b/Lib/distutils/tests/test_bdist_rpm.py @@ -28,6 +28,11 @@ class BuildRpmTestCase(support.TempdirManager, unittest.TestCase): def setUp(self): + try: + sys.executable.encode("UTF-8") + except UnicodeEncodeError: + raise unittest.SkipTest("sys.executable is not encodable to UTF-8") + super(BuildRpmTestCase, self).setUp() self.old_location = os.getcwd() self.old_sys_argv = sys.argv, sys.argv[:]