Comment 16 for bug 505078

Revision history for this message
Martin Pool (mbp) wrote : Re: copy and paste or newline mangling can damage streams

I propose to add the following to the protocol spec:

=== modified file 'README'
--- README 2009-10-10 03:42:32 +0000
+++ README 2010-06-15 08:21:50 +0000
@@ -159,13 +159,17 @@
 tags: [-]TAG ...
 time: YYYY-MM-DD HH:MM:SSZ

-DETAILS ::= BRACKETED | MULTIPART
+DETAILS ::= BRACKETED | MULTIPART | QUOPRI_DETAILS
 BRACKETED ::= '[' CR lines ']' CR
 MULTIPART ::= '[ multipart' CR PART* ']' CR
 PART ::= PART_TYPE CR NAME CR PART_BYTES CR
 PART_TYPE ::= Content-Type: type/sub-type(;parameter=value,parameter=value)
 PART_BYTES ::= (DIGITS CR LF BYTE{DIGITS})* '0' CR LF

+QUOPRI_DETAILS ::= '[ quopri' QP_EOL QP_LINE* QP_EOL ']' CR
+QP_EOL = CR | CR LF | LF
+QP_LINE = *QP_CHAR ['='] QP_EOL
+
 unexpected output on stdout -> stdout.
 exit w/0 or last test completing -> error

@@ -175,6 +179,14 @@
 A '-' before a tag is used to remove tags - e.g. to prevent a global tag
 applying to a single test, or to cancel a global tag.

+Quoted-Printable detail sections (QUOPRI_DETAILS) are supported only after
+0.0.5 but are recommended because they are more robust against line-ending
+conversions or other whitespace transformation of the stream. (See
+<https://launchpad.net/bugs/505078>.)
+The format is the same as that of RFC 1521 section 5.1 <http://tools.ietf.org/html/rfc1521.html#page-18>.
+The grammar from RFC 1521 is included by reference, with the clarification that
+any type of line-ending is permitted.
+
 The progress directive is used to provide progress information about a stream
 so that stream consumer can provide completion estimates, progress bars and so
 on. Stream generators that know how many tests will be present in the stream