Stephen Emslie added the comment:
Here's that keeps the whitespace in tact, along with a simple test. This
doesn't patch docs as the existing documentation_ already describes the
long string as multiple lines of "plain text in reStructuredText
format", whic
New submission from Stephen Emslie:
distutils.util.rfc822_escape strips each line of its whitespace before
indenting, but this can mean losing meaningful whitespace, such as in
reStructuredText.
distutils uses rfc822_escape to escape fields in metadata, such as
PKG-INFO. This unfortunately