Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3d59781

Browse files
committed
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.
1 parent d5ac8d0 commit 3d59781

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Lib/email/test/test_email.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (C) 2001,2002 Python Software Foundation
1+
# Copyright (C) 2001,2002,2003 Python Software Foundation
22
# email package unit tests
33

44
import sys
@@ -50,9 +50,9 @@
5050

5151

5252

53-
def openfile(filename):
53+
def openfile(filename, mode='r'):
5454
path = os.path.join(os.path.dirname(landmark), 'data', filename)
55-
return open(path, 'r')
55+
return open(path, mode)
5656

5757

5858

@@ -1883,7 +1883,7 @@ def test_whitespace_continuaton(self):
18831883

18841884
def test_crlf_separation(self):
18851885
eq = self.assertEqual
1886-
fp = openfile('msg_26.txt')
1886+
fp = openfile('msg_26.txt', mode='rb')
18871887
try:
18881888
msg = Parser().parse(fp)
18891889
finally:

0 commit comments

Comments
 (0)