#11062: Fix adding a message from file to Babyl mailbox
This commit is contained in:
parent
2b209cd78d
commit
3d12c4317c
@ -1443,9 +1443,9 @@ class Babyl(_singlefileMailbox):
|
|||||||
line = line[:-1] + b'\n'
|
line = line[:-1] + b'\n'
|
||||||
self._file.write(line.replace(b'\n', linesep))
|
self._file.write(line.replace(b'\n', linesep))
|
||||||
if line == b'\n' or not line:
|
if line == b'\n' or not line:
|
||||||
self._file.write(b'*** EOOH ***' + linesep)
|
|
||||||
if first_pass:
|
if first_pass:
|
||||||
first_pass = False
|
first_pass = False
|
||||||
|
self._file.write(b'*** EOOH ***' + linesep)
|
||||||
message.seek(original_pos)
|
message.seek(original_pos)
|
||||||
else:
|
else:
|
||||||
break
|
break
|
||||||
|
@ -148,8 +148,6 @@ class TestMailbox(TestBase):
|
|||||||
f.write(_bytes_sample_message)
|
f.write(_bytes_sample_message)
|
||||||
f.seek(0)
|
f.seek(0)
|
||||||
key = self._box.add(f)
|
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.assertEqual(self._box.get_bytes(key).split(b'\n'),
|
||||||
_bytes_sample_message.split(b'\n'))
|
_bytes_sample_message.split(b'\n'))
|
||||||
|
|
||||||
@ -158,8 +156,6 @@ class TestMailbox(TestBase):
|
|||||||
f.write(self._non_latin_bin_msg)
|
f.write(self._non_latin_bin_msg)
|
||||||
f.seek(0)
|
f.seek(0)
|
||||||
key = self._box.add(f)
|
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.assertEqual(self._box.get_bytes(key).split(b'\n'),
|
||||||
self._non_latin_bin_msg.split(b'\n'))
|
self._non_latin_bin_msg.split(b'\n'))
|
||||||
|
|
||||||
@ -169,8 +165,6 @@ class TestMailbox(TestBase):
|
|||||||
f.seek(0)
|
f.seek(0)
|
||||||
with self.assertWarns(DeprecationWarning):
|
with self.assertWarns(DeprecationWarning):
|
||||||
key = self._box.add(f)
|
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.assertEqual(self._box.get_bytes(key).split(b'\n'),
|
||||||
_bytes_sample_message.split(b'\n'))
|
_bytes_sample_message.split(b'\n'))
|
||||||
|
|
||||||
|
@ -101,6 +101,8 @@ Core and Builtins
|
|||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #11062: Fix adding a message from file to Babyl mailbox.
|
||||||
|
|
||||||
- Issue #15646: Prevent equivalent of a fork bomb when using
|
- Issue #15646: Prevent equivalent of a fork bomb when using
|
||||||
multiprocessing on Windows without the "if __name__ == '__main__'"
|
multiprocessing on Windows without the "if __name__ == '__main__'"
|
||||||
idiom.
|
idiom.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user