Patches item #1757839, was opened at 2007-07-20 18:45
Message generated for change (Comment added) made by avassalotti
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1757839&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 3000
Status: Closed
Resolution: Accepted
Priority: 5
Private: No
Submitted By: Alexandre Vassalotti (avassalotti)
Assigned to: Nobody/Anonymous (nobody)
Summary: struni: make test_mailbox and test_old_mailbox pass
Initial Comment:
This patch make reads to a file return a string of the str type. This required
to change the mode of certain call to open() to non-binary. I have no idea if
this will cause problem, but at least the tests pass. If someone wants to keep
opening these file in binary mode, then he will have to create a "proxy" class,
like _ProxyFile in mailbox.py but with writing support, since file opened in
binary mode always return string of the bytes type. Another solution would be
to wrap every read() and readline() calls, on these files, with str().
----------------------------------------------------------------------
>Comment By: Alexandre Vassalotti (avassalotti)
Date: 2007-07-20 21:17
Message:
Logged In: YES
user_id=1826340
Originator: YES
I corrected the patch. It was a small error that slipped through when I
separated to two changes to make them easier to review. (Sometime, I wish
svn had a checkpoint feature or offline commits for this...)
File Added: 02_better_failure_msg.patch
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2007-07-20 20:21
Message:
Logged In: YES
user_id=6380
Originator: NO
Looks like that was a bug in the second patch. I'll ignore it for now.
The main patch is:
Committed revision 56474.
----------------------------------------------------------------------
Comment By: Guido van Rossum (gvanrossum)
Date: 2007-07-20 20:20
Message:
Logged In: YES
user_id=6380
Originator: NO
Am I supposed to apply both patches one after another?
I still get two errors:
======================================================================
ERROR: test_add_and_close (__main__.TestMbox)
----------------------------------------------------------------------
Traceback (most recent call last):
File "Lib/test/test_mailbox.py", line 737, in test_add_and_close
self.assertEqual(contents == open(self._path, 'r').read())
TypeError: failUnlessEqual() takes at least 3 positional arguments (2
given)
======================================================================
ERROR: test_add_and_close (__main__.TestMMDF)
----------------------------------------------------------------------
Traceback (most recent call last):
File "Lib/test/test_mailbox.py", line 737, in test_add_and_close
self.assertEqual(contents == open(self._path, 'r').read())
TypeError: failUnlessEqual() takes at least 3 positional arguments (2
given)
----------------------------------------------------------------------
----------------------------------------------------------------------
Comment By: Alexandre Vassalotti (avassalotti)
Date: 2007-07-20 18:49
Message:
Logged In: YES
user_id=1826340
Originator: YES
Here another patch that makes the failure message a little more
descriptive.
To apply both:
cat 01_fix_mailbox.patch 02_better_failure_msg.patch | patch -p0
File Added: 02_better_failure_msg.patch
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1757839&group_id=5470
_______________________________________________
Patches mailing list
[email protected]
http://mail.python.org/mailman/listinfo/patches