pqm error formatting

Vincent Ladeuil v.ladeuil+lp at free.fr
Tue Jun 15 07:29:24 BST 2010


>>>>> Martin Pool <mbp at canonical.com> writes:

    > On 11 June 2010 11:31, Robert Collins <robert.collins at canonical.com> wrote:
    >> PQM is currently giving strange error emails because of an old
    >> internal code issue that mingles stdout and stderr without rhyme or
    >> reason, and can mix them up mid-line.
    >> 
    >> Aaron contributed a partial patch for email attachment support, and I
    >> have a polished version of that that should make things better, but
    >> we've hit a few differences between lucid & the PQM machine itself
    >> trying to deploy it; probably early next week should see it in place.

    > As of today you still get malformed subunit output if a test fails in
    > pqm.

I've got one such mail and use the following quick-and-dirty fix to be
able to parse it successfully:

   modified      python/subunit/chunked.py
                                                                        

=== modified file 'python/subunit/chunked.py'
--- python/subunit/chunked.py	2009-10-13 04:52:06 +0000
+++ python/subunit/chunked.py	2010-06-14 14:02:30 +0000
@@ -87,7 +87,7 @@
         if count_chars[-1][-1] != '\n':
             return
         count_str = ''.join(count_chars)
-        self.body_length = int(count_str[:-2], 16)
+        self.body_length = int(count_str[:-1], 16)
         excess_bytes = len(count_str)
         while excess_bytes:
             if excess_bytes >= len(self.buffered_bytes[0]):

Without more investigation, I strongly suspect a '\r\n' vs '\n'
issue. Since the fix is simple I wonder if subunit can't just be more
tolerant and accept both end-of-lines at *this* particular place (I've
no idea if this code is used for processing other parts than the highest
level structure so I have no strong feeling there).

    > Robert and spm are going to try rolling out another fix this
    > afternoon.

Please, please, configure the news_merge plugin ! I had several
submissions failing because of that and that... sucks. Kind of the
shoemaker having worse shoes than everybody else...

Sugar on top would be to add John's update_copyright plugin too :)

    > If that fixes it, great.  Otherwise, we will turn off subunit
    > output again and then do future changes to this into a staging pqm
    > so it's less disruptive.

Fine by me, but being the Patch Pilot this week, I'm ready to endure the
pain one more week if it helps getting it right though.

     Vincent




More information about the bazaar mailing list