summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_winconsoleio.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2018-02-24 16:55:51 (GMT)
committerGitHub <noreply@github.com>2018-02-24 16:55:51 (GMT)
commit42c35d9c0c8175332f50fbe034a001fe52f057b9 (patch)
tree00485d2cfcf5a47eec398a87cd6751f444978733 /Lib/test/test_winconsoleio.py
parentaef1283ba428e33397d87cee3c54a5110861552d (diff)
downloadcpython-42c35d9c0c8175332f50fbe034a001fe52f057b9.zip
cpython-42c35d9c0c8175332f50fbe034a001fe52f057b9.tar.gz
cpython-42c35d9c0c8175332f50fbe034a001fe52f057b9.tar.bz2
bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data. (GH-5754)
Diffstat (limited to 'Lib/test/test_winconsoleio.py')
-rw-r--r--Lib/test/test_winconsoleio.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_winconsoleio.py b/Lib/test/test_winconsoleio.py
index 656483c..a78fa4d 100644
--- a/Lib/test/test_winconsoleio.py
+++ b/Lib/test/test_winconsoleio.py
@@ -121,6 +121,10 @@ class WindowsConsoleIOTests(unittest.TestCase):
else:
self.assertNotIsInstance(f, ConIO)
+ def test_write_empty_data(self):
+ with ConIO('CONOUT$', 'w') as f:
+ self.assertEqual(f.write(b''), 0)
+
def assertStdinRoundTrip(self, text):
stdin = open('CONIN$', 'r')
old_stdin = sys.stdin