[Python-checkins] cpython (merge 3.2 -> default): #11062: Fix adding a message from file to Babyl mailbox
Andrew Svetlov
andrew.svetlov at gmail.com
Wed Aug 15 16:17:16 CEST 2012
Looks like it is the source of buildbot fail on Windows box.
On Wed, Aug 15, 2012 at 2:42 PM, petri.lehtinen
<python-checkins at python.org> wrote:
> http://hg.python.org/cpython/rev/7c8c6b905a18
> changeset: 78586:7c8c6b905a18
> parent: 78583:8d90fde35cc6
> parent: 78585:cbc1dc8cda06
> user: Petri Lehtinen <petri at digip.org>
> date: Wed Aug 15 14:36:14 2012 +0300
> summary:
> #11062: Fix adding a message from file to Babyl mailbox
>
> files:
> Lib/mailbox.py | 2 +-
> Lib/test/test_mailbox.py | 18 ++++++------------
> Misc/NEWS | 2 ++
> 3 files changed, 9 insertions(+), 13 deletions(-)
>
>
> diff --git a/Lib/mailbox.py b/Lib/mailbox.py
> --- a/Lib/mailbox.py
> +++ b/Lib/mailbox.py
> @@ -1440,9 +1440,9 @@
> line = line[:-1] + b'\n'
> self._file.write(line.replace(b'\n', linesep))
> if line == b'\n' or not line:
> - self._file.write(b'*** EOOH ***' + linesep)
> if first_pass:
> first_pass = False
> + self._file.write(b'*** EOOH ***' + linesep)
> message.seek(original_pos)
> else:
> break
> diff --git a/Lib/test/test_mailbox.py b/Lib/test/test_mailbox.py
> --- a/Lib/test/test_mailbox.py
> +++ b/Lib/test/test_mailbox.py
> @@ -152,20 +152,16 @@
> f.write(_bytes_sample_message)
> f.seek(0)
> key = self._box.add(f)
> - # See issue 11062
> - if not isinstance(self._box, mailbox.Babyl):
> - self.assertEqual(self._box.get_bytes(key).split(b'\n'),
> - _bytes_sample_message.split(b'\n'))
> + self.assertEqual(self._box.get_bytes(key).split(b'\n'),
> + _bytes_sample_message.split(b'\n'))
>
> 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)
> - # See issue 11062
> - if not isinstance(self._box, mailbox.Babyl):
> - self.assertEqual(self._box.get_bytes(key).split(b'\n'),
> - self._non_latin_bin_msg.split(b'\n'))
> + self.assertEqual(self._box.get_bytes(key).split(b'\n'),
> + self._non_latin_bin_msg.split(b'\n'))
>
> def test_add_text_file_warns(self):
> with tempfile.TemporaryFile('w+') as f:
> @@ -173,10 +169,8 @@
> f.seek(0)
> with self.assertWarns(DeprecationWarning):
> key = self._box.add(f)
> - # See issue 11062
> - if not isinstance(self._box, mailbox.Babyl):
> - self.assertEqual(self._box.get_bytes(key).split(b'\n'),
> - _bytes_sample_message.split(b'\n'))
> + self.assertEqual(self._box.get_bytes(key).split(b'\n'),
> + _bytes_sample_message.split(b'\n'))
>
> def test_add_StringIO_warns(self):
> with self.assertWarns(DeprecationWarning):
> diff --git a/Misc/NEWS b/Misc/NEWS
> --- a/Misc/NEWS
> +++ b/Misc/NEWS
> @@ -13,6 +13,8 @@
> Library
> -------
>
> +- Issue #11062: Fix adding a message from file to Babyl mailbox.
> +
> - Issue #15646: Prevent equivalent of a fork bomb when using
> multiprocessing on Windows without the "if __name__ == '__main__'"
> idiom.
>
> --
> Repository URL: http://hg.python.org/cpython
>
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> http://mail.python.org/mailman/listinfo/python-checkins
>
--
Thanks,
Andrew Svetlov
More information about the Python-checkins
mailing list