cpython: 7c8c6b905a18 (original) (raw)

Mercurial > cpython

changeset 78586:7c8c6b905a18

#11062: Fix adding a message from file to Babyl mailbox [#11062]

Petri Lehtinen petri@digip.org
date Wed, 15 Aug 2012 14:36:14 +0300
parents 8d90fde35cc6(current diff)cbc1dc8cda06(diff)
children f46b4b7b817c
files Lib/mailbox.py Lib/test/test_mailbox.py Misc/NEWS
diffstat 3 files changed, 9 insertions(+), 13 deletions(-)[+] [-] Lib/mailbox.py 2 Lib/test/test_mailbox.py 18 Misc/NEWS 2

line wrap: on

line diff

--- a/Lib/mailbox.py +++ b/Lib/mailbox.py @@ -1440,9 +1440,9 @@ class Babyl(_singlefileMailbox): line = line[:-1] + b'\n' self._file.write(line.replace(b'\n', linesep)) if line == b'\n' or not line:

--- a/Lib/test/test_mailbox.py +++ b/Lib/test/test_mailbox.py @@ -152,20 +152,16 @@ class TestMailbox(TestBase): f.write(_bytes_sample_message) f.seek(0) key = self._box.add(f)

def test_add_binary_nonascii_file(self): with tempfile.TemporaryFile('wb+') as f: f.write(self._non_latin_bin_msg) f.seek(0) key = self._box.add(f)

def test_add_text_file_warns(self): with tempfile.TemporaryFile('w+') as f: @@ -173,10 +169,8 @@ class TestMailbox(TestBase): f.seek(0) with self.assertWarns(DeprecationWarning): key = self._box.add(f)

def test_add_StringIO_warns(self): with self.assertWarns(DeprecationWarning):

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -13,6 +13,8 @@ Core and Builtins Library ------- +- Issue #11062: Fix adding a message from file to Babyl mailbox. +