]> granicus.if.org Git - python/commitdiff
Fix the tests on Windows, by writing the test data file in binary
authorGuido van Rossum <guido@python.org>
Fri, 25 Apr 2003 15:01:05 +0000 (15:01 +0000)
committerGuido van Rossum <guido@python.org>
Fri, 25 Apr 2003 15:01:05 +0000 (15:01 +0000)
mode.

XXX I'm not convinced that this is the right solution -- arguably,
on Windows, the _fileobject class should honor the mode argument
and do newline translation.  But it's never done that so I think
there's no urgent need to fix this today.

Lib/test/test_urllib.py

index 67252891d63d302540c63d9eba4decd60f1e6bcd..7d557a1e08ab96196ae42a35955ec8a3b35ca1b1 100644 (file)
@@ -24,7 +24,7 @@ class urlopen_FileTests(unittest.TestCase):
     def setUp(self):
         """Setup of a temp file to use for testing"""
         self.text = "test_urllib: %s\n" % self.__class__.__name__
-        FILE = file(test_support.TESTFN, 'w')
+        FILE = file(test_support.TESTFN, 'wb')
         try:
             FILE.write(self.text)
         finally: