Index: Lib/distutils/tests/test_dist.py =================================================================== --- Lib/distutils/tests/test_dist.py (revision 60389) +++ Lib/distutils/tests/test_dist.py (working copy) @@ -176,6 +176,20 @@ "version": "1.0", "obsoletes": ["my.pkg (splat)"]}) + def test_long_description(self): + import textwrap + long_desc = textwrap.dedent("""\ + example:: + We start here + and continue here + and end here.""") + attrs = {"name": "package", + "version": "1.0", + "long_description": long_desc} + dist = distutils.dist.Distribution(attrs) + meta = self.format_metadata(dist).replace('\n'+' '*8, '\n') + self.assert_(long_desc in meta) + def format_metadata(self, dist): sio = StringIO.StringIO() dist.metadata.write_pkg_file(sio) Index: Lib/distutils/util.py =================================================================== --- Lib/distutils/util.py (revision 60389) +++ Lib/distutils/util.py (working copy) @@ -527,6 +527,5 @@ RFC-822 header, by ensuring there are 8 spaces space after each newline. """ lines = string.split(header, '\n') - lines = map(string.strip, lines) header = string.join(lines, '\n' + 8*' ') return header