mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
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.
This commit is contained in:
parent
d5ac8d0b39
commit
3d597812b6
1 changed files with 4 additions and 4 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue