Author demian.brecht
Recipients Aaron1011, a.badger, berker.peksag, demian.brecht, jcea, michael.foord
Date 2014-12-13.03:41:18
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Thanks for the patch Aaron. Unfortunately this doesn't quite fix the issue. There are two problems with the patch:

If a bytes object is passed into mock_open, I'd expect a bytes object in the output. In your patch, not only is this not the case (the output is a string object), but the bytes object is being coerced into its string representation in the resulting list. For example (simplified from your patch):

>>> data = b'foo\nbar'
>>> newline = b'\n'
>>> ['{}\n'.format(l) for l in data.split(newline)]
["b'foo'\n", "b'bar'\n"]

What I would expect to see in this case is:

[b'foo\n', b'bar\n']
Date User Action Args
2014-12-13 03:41:18demian.brechtsetrecipients: + demian.brecht, jcea, a.badger, michael.foord, berker.peksag, Aaron1011
2014-12-13 03:41:18demian.brechtsetmessageid: <>
2014-12-13 03:41:18demian.brechtlinkissue23004 messages
2014-12-13 03:41:18demian.brechtcreate