Author gac
Recipients barry, gac, r.david.murray
Date 2013-01-14.10:56:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1358161021.55.0.14673184928.issue16914@psf.upfronthosting.co.za>
In-reply-to
Content
Here's a second path I've done for the current/default branch, using a separate print function for output, as recommended by Berker Peksag. I tried to add it as a separate patch set using the code review tool but every time I did, I just got a screen full of debug output from Django so I'm going to attach it here instead.

The for loop on args inside _print_debug probably isn't ideal, but I've done this to try and make sure that debuglevel 1 output is identical to what it was before my patches. Because args is passed into _print_debug as a tuple, I found that when doing "print(message, args, file=stderr)" it introduced the extra parentheses and quotes inherent with a tuple into the output. By concatenating string representations of this tuple onto the existing string it means the original output format is duplicated exactly. There may be a speed penalty for this, but realistically it seems that a minor speed penalty would be expected when using debugging options and the output consistency trumps raw speed for debugging.

Once I've found a way of achieving the same in 2.7 (i.e. maintaining the original output format when being passed a tuple, the approach I've used for Python 3 doesn't seem to have the desired affect in 2.7) then I'll hopefully submit a patch for that as well.
History
Date User Action Args
2013-01-14 10:57:01gacsetrecipients: + gac, barry, r.david.murray
2013-01-14 10:57:01gacsetmessageid: <1358161021.55.0.14673184928.issue16914@psf.upfronthosting.co.za>
2013-01-14 10:57:01gaclinkissue16914 messages
2013-01-14 10:57:00gaccreate