[Distutils] RFC822, PKG-INFO and the Description field

Tarek Ziadé ziade.tarek at gmail.com
Sat Dec 5 03:49:13 CET 2009


Hi,

I am currently fixing a bug in Distutils: http://bugs.python.org/issue1923

this bugs makes a Description field like:

"""
Text::
       a literal python block::
       >>> import this
"""

Transformed into :

"""
Text::
a literal python block::
>>> import this
"""

Which is fine for RFC822 compliancy but sucks for reST if someone
wants to parse it back.

There's another problem: empty lines.

For instance:

"""
Description: Text::

       a literal python block::

           >>> import this
"""

Will not be parseable with rfc822 because the first empty line ends the header.

IOW we need to encode that multi-line field differently.

I want to take the chance that we are changing PEP 345, to introduce a
smarter marker
in 1.2, that will add a character (:) after the 8 spaces to avoid
losing empty lines:

"""
Description: Text::
       :
       :a literal python block::
       :
       :    >>> import this
"""

So we are able to unparse it.

Thoughts ?

Regards
Tarek


More information about the Distutils-SIG mailing list