[Python-bugs-list] [ python-Bugs-629756 ] FAIL: test_crlf_separation (email.test.t

noreply@sourceforge.net noreply@sourceforge.net
Tue, 29 Oct 2002 03:28:40 -0800


Bugs item #629756, was opened at 2002-10-28 11:13
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=629756&group_id=5470

Category: Windows
Group: Platform-specific
Status: Open
Resolution: None
Priority: 5
Submitted By: Grzegorz Makarewicz (makaron)
Assigned to: Barry A. Warsaw (bwarsaw)
Summary: FAIL: test_crlf_separation (email.test.t

Initial Comment:

just because text file on windows has CR/LF as endline
maker and this test expects LF as eol.


----------------------------------------------------------------------

>Comment By: Grzegorz Makarewicz (makaron)
Date: 2002-10-29 12:28

Message:
Logged In: YES 
user_id=115179

Python 2.2.2 from October 14, 2002, compiled from source on
windows 2000
all expected test are passed but not test_email.
reproducable by:
pushd Lib\test
..\..\python regrtest.py
popd
--
or
cd Lib\test
..\..\python test_email.py

traceback:
FAILED (failures=1)
Traceback (most recent call last):
  File "test_email.py", line 13, in ?
    test_main()
  File "test_email.py", line 10, in test_main
    run_suite(suite())
  File "c:\binw\py222\lib\test\test_support.py", line 175,
in run_suite
    raise TestFailed(err)
test_support.TestFailed: Traceback (most recent call last):
  File "c:\binw\py222\lib\email\test\test_email.py", line
1851, in test_crlf_sep
aration
    eq(part1.get_payload(), 'Simple email with
attachment.\r\n\r\n')
  File "c:\binw\py222\lib\unittest.py", line 286, in
failUnlessEqual
    raise self.failureException, \
AssertionError: 'Simple email with attachment.\n\n' !=
'Simple email with attach
ment.\r\n\r\n'

after applying this patch thist test will pass
--- test_email.py       Mon Oct 14 17:26:03 2002
+++ test_email.py.new  Tue Oct 29 11:25:54 2002
@@ -46,7 +46,7 @@
 
 def openfile(filename):
     path = os.path.join(os.path.dirname(landmark), 'data',
filename)
-    return open(path, 'r')
+    return open(path, 'rb')


----------------------------------------------------------------------

Comment By: Tim Peters (tim_one)
Date: 2002-10-28 16:33

Message:
Logged In: YES 
user_id=31435

Assigned to Barry.  Grzegorz, please supply more detail, 
such as which version of Python you're using, and the 
commands you used to run this test.

As the name of the test should imply ("test_crlf_....), the 
test *expects* CR/LF -- that's it's point.  It passes for me 
under 2.2.2 and current CVS Python, under Win98SE and 
Win2K.  It may not have passed in 2.2.1, though.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=629756&group_id=5470