Skip to content
Prev Previous commit
Next Next commit
Skip testcase on Windows - after timeout the threads reading output a…
…re left running
  • Loading branch information
LewisGaul committed Aug 2, 2022
commit a2c7e068326e16d163f94862579b2f569681c2be
1 change: 1 addition & 0 deletions Lib/test/test_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -1129,6 +1129,7 @@ def test_universal_newlines_communicate_encodings(self):
stdout, stderr = popen.communicate(input='')
self.assertEqual(stdout, '1\n2\n3\n4')

@unittest.skipIf(mswindows, "behavior currently not supported on Windows")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is needed for this to work on Windows?

having inconsistent behavior in the returned stderr/stdout types on Timeout between the two platforms will make people's code difficult.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hah, I didn't even notice this.

I'm guessing this should actually be "platforms that don't default to UTF-8 don't trigger the decoding error", which luckily is easily resolved by explicitly specifying that the encoding should be utf-8.

def test_universal_newlines_timeout(self):
with self.assertRaises(subprocess.TimeoutExpired) as c:
p = subprocess.run(
Expand Down