Proposed changes to logging defaults

Steve Holden steve at holdenweb.com
Wed Dec 15 08:06:12 EST 2010


On 12/15/2010 5:03 AM, Vinay Sajip wrote:
> On Dec 15, 8:46 am, John Nagle <na... at animats.com> wrote:
>>     You're assuming that theloggingpackage has the right to blither
>> on the default sys.stderr.  There are many cases in which it
>> should not.  The program could be running in a web server, and
>> output would end up in the output HTML.  The program could be
>> running as a subprocess, and the output could end up in the
>> pipe back to the the parent.  "sys.stderr" might be connected
>> to a dead pipe, and writing to it would then kill the program.
>>
>>     So this change could break existing programs in subtle ways.
> 
> I'm not assuming anything, and the rationale for the change is
> described in detail in the linked-to post. The reason for posting the
> link on this list is to give people advance warning of the changes, so
> they can see if they're affected and take the appropriate action.
> 
> Note that since this change only affects the user who is using Python
> 3.2 and has not configured logging. Since the necessary configuration
> is easy to do, I'm assuming people who might be affected can easily
> update their code in time for the 3.2 release.
> 
I might add that any web server that sends sys.stderr to the HTTP output
stream is not likely to be professionally managed. It's far preferable,
in the general case, to ensure that logging messages do not enter the
stdout-stdin pipelines carrying information between coordinating processes.

If a current task is assuming the prior logging package's behavior and
analysing a process's stdout for messages it arguably needs fixing
anyway, though I agree that breakage of any kind is unfortunate.

regards
 Steve
-- 
Steve Holden           +1 571 484 6266   +1 800 494 3119
PyCon 2011 Atlanta March 9-17       http://us.pycon.org/
See Python Video!       http://python.mirocommunity.org/
Holden Web LLC                 http://www.holdenweb.com/




More information about the Python-list mailing list