[Python-Dev] rfc822_escape doing the right thing? (original) (raw)
stephen emslie stephenemslie at gmail.com
Thu Jan 24 16:48:05 CET 2008
- Previous message: [Python-Dev] Incorrect documentation of the raw_input built-in function
- Next message: [Python-Dev] trunc()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I have created issue #1923 to keep track of this.
Stephen Emslie
On Jan 23, 2008 6:00 PM, Gregory P. Smith <greg at krypto.org> wrote:
could you put this on bugs.python.org and follow up with a reference to the issue # for better tracking?
On 1/23/08, stephen emslie <stephenemslie at gmail.com> wrote: > > > > I've been working on a project that renders PKG-INFO metadata in a > number of ways. I have noticed that fields with any indentation were > flattened out, which is being done in distutils.util.rfc822escape. > This unfortunately means that you cant use reStructuredText formatting > in your long description (suggested in PEP345), or are limited to a > set that doesn't require indentation (no block quotes, etc.). > > It looks like this behavior was intentionally added in rev 20099, but > that was about 7 years ago - before reStructuredText and eggs. I > wonder if it makes sense to re-think that implementation with this > sort of metadata in mind, assuming this behavior isn't required to be > rfc822 compliant. I think it would certainly be a shame to miss out on > a good thing like proper (renderable) reST in our metadata. > > A quick example of what I mean: > > >>> rest = """ > ... a literal python block:: > ... >>> import this > ... """ > >>> print distutils.util.rfc822escape(rest) > > a literal python block:: > >>> import this > > should look something like: > > a literal python block:: > >>> import this > > > Is distutils being over-cautious in flattening out all whitespace? A > w3c discussion on multiple lines in rfc822 [1] seems to suggest that > whitespace can be 'unfolded' safely, so it seems a shame to be > throwing it away when it can have important meaning. > > [1] http://www.w3.org/Protocols/rfc822/3Lexical.html > > Thanks for any comments > > Stephen Emslie _> ________________________ > Python-Dev mailing list > Python-Dev at python.org > http://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: http://mail.python.org/mailman/options/python-dev/greg%40krypto.org >
- Previous message: [Python-Dev] Incorrect documentation of the raw_input built-in function
- Next message: [Python-Dev] trunc()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]