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 <1418442078.72.0.491346043221.issue23004@psf.upfronthosting.co.za>
In-reply-to
Content
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']
History
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: <1418442078.72.0.491346043221.issue23004@psf.upfronthosting.co.za>
2014-12-13 03:41:18demian.brechtlinkissue23004 messages
2014-12-13 03:41:18demian.brechtcreate