From 3d597812b655ffd437997f8e47080ed4225dbd86 Mon Sep 17 00:00:00 2001 From: Barry Warsaw Date: Thu, 2 Jan 2003 22:48:36 +0000 Subject: Jack complained that on test_crlf_separation() was failing on MacOS9 because the test file, msg_26.txt which has \r\n line endings, was getting munged by cvs, which knows to do line ending conversions for text files. But we want \r\n to be preserved on all platforms, so we cvs admin'd the file to be -kb (binary), which means we have to open the file in binary mode to preserve these line ends. Hopefully this will be the end of the thrashing on this issue (but probably not). Test passes on *nix now, and Tim confirms it passes on Windows. We'll leave it to Jack to test MacOS. --- Lib/email/test/test_email.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/email/test/test_email.py b/Lib/email/test/test_email.py index 1c77819..59e6724 100644 --- a/Lib/email/test/test_email.py +++ b/Lib/email/test/test_email.py @@ -1,4 +1,4 @@ -# Copyright (C) 2001,2002 Python Software Foundation +# Copyright (C) 2001,2002,2003 Python Software Foundation # email package unit tests import sys @@ -50,9 +50,9 @@ except NameError: -def openfile(filename): +def openfile(filename, mode='r'): path = os.path.join(os.path.dirname(landmark), 'data', filename) - return open(path, 'r') + return open(path, mode) @@ -1883,7 +1883,7 @@ Here's the message body def test_crlf_separation(self): eq = self.assertEqual - fp = openfile('msg_26.txt') + fp = openfile('msg_26.txt', mode='rb') try: msg = Parser().parse(fp) finally: -- cgit v0.12