title: MIMEBase: conversion to bytes and back again removes \r in binary data: Documented or just broken behavior in Python 3?
body: <p>It seems to me like email.Message.as_bytes is broken:</p>
  
  <pre><code>import email
  
  from email.encoders import encode_7or8bit
  from email.mime.base import MIMEBase
  
  orig_data = b"Zeilenenden\n&lt;Unix\r\n&lt;DOS\rMac"
  
  msg = MIMEBase('application/octet-stream', "gzip")
  
  msg.set_payload(orig_data)
  
  encode_7or8bit(msg)
  
  print("orig_data = %r" % orig_data)
  print("payload   = %r" % msg.get_payload(decode=1))
  
  b = msg.as_bytes()
  msg2 = email.message_from_bytes(b)
  print("payload2  = %r" % msg2.get_payload(decode=1))
  </code></pre>
  
  <p>The output is</p>
  
  <pre><code>orig_data = b'Zeilenenden\n&lt;Unix\r\n&lt;DOS\rMac'
  payload   = b'Zeilenenden\n&lt;Unix\r\n&lt;DOS\rMac'
  payload2  = b'Zeilenenden\n&lt;Unix\n&lt;DOS\nMac'
  </code></pre>
  
  <p>Note how the conversion message > bytes > message breaks the binary payload.</p>
  
  <p>This used to work with similar code in Python 2.</p>
  
  <p>Is this a bug or intended and if so where is it documented?</p>