﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
127	Strip whitespace at the end of <?python ?> blocks	Dale Sedivec <dale-keyword-genshi.e8bcba@…>	cmlenz	"A line containing nothing but whitespace at the end of a `<?python>` PI raises a syntax error:

{{{
#!python
>>> from genshi.template import MarkupTemplate
>>> tmpl = MarkupTemplate(""<foo><?python print 'hi'\n ?></foo>"")
Traceback (most recent call last):
  ...
genshi.template.base.TemplateSyntaxError: invalid syntax (None, line 2)
}}}

This exception is present in 0.4.1 as well as SVN head.  It seems to me that whitespace at the end of a python PI should be permitted, since it seems typical to indent the block.  For example:

{{{
#!xml
<foo>
    <?python
        bar = 42
    ?>
</foo>
}}}

I threw an rstrip in the PI parsing code: all tests pass (Python 2.4), as well as my above snippet.  Patch against SVN head attached."	defect	closed	minor	0.4.2	Parsing	0.4	fixed	python processing instruction pi code block space whitespace	
