summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncore.py
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2008-09-15 23:02:56 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2008-09-15 23:02:56 (GMT)
commit9cadb1b6e0d10aaeb8f9e69e51f672a53de6b164 (patch)
treee39eac97c8d501a20d6f336ccddcc169f585271d /Lib/test/test_asyncore.py
parent4e80cdd739772406bba00a31fdd98539cdcca651 (diff)
downloadcpython-9cadb1b6e0d10aaeb8f9e69e51f672a53de6b164.zip
cpython-9cadb1b6e0d10aaeb8f9e69e51f672a53de6b164.tar.gz
cpython-9cadb1b6e0d10aaeb8f9e69e51f672a53de6b164.tar.bz2
Issue #3782: os.write() must not accept unicode strings
Diffstat (limited to 'Lib/test/test_asyncore.py')
-rw-r--r--Lib/test/test_asyncore.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py
index 12ef247..940b45e 100644
--- a/Lib/test/test_asyncore.py
+++ b/Lib/test/test_asyncore.py
@@ -381,8 +381,8 @@ class DispatcherWithSendTests_UsePoll(DispatcherWithSendTests):
if hasattr(asyncore, 'file_wrapper'):
class FileWrapperTest(unittest.TestCase):
def setUp(self):
- self.d = "It's not dead, it's sleeping!"
- open(TESTFN, 'w').write(self.d)
+ self.d = b"It's not dead, it's sleeping!"
+ open(TESTFN, 'wb').write(self.d)
def tearDown(self):
unlink(TESTFN)
@@ -400,8 +400,8 @@ if hasattr(asyncore, 'file_wrapper'):
self.assertRaises(OSError, w.read, 1)
def test_send(self):
- d1 = "Come again?"
- d2 = "I want to buy some cheese."
+ d1 = b"Come again?"
+ d2 = b"I want to buy some cheese."
fd = os.open(TESTFN, os.O_WRONLY | os.O_APPEND)
w = asyncore.file_wrapper(fd)
os.close(fd)
@@ -409,7 +409,7 @@ if hasattr(asyncore, 'file_wrapper'):
w.write(d1)
w.send(d2)
w.close()
- self.assertEqual(open(TESTFN).read(), self.d + d1 + d2)
+ self.assertEqual(open(TESTFN, 'rb').read(), self.d + d1 + d2)
def test_main():