Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #19992

Re: PythonWin debugger holds onto global logging objects too long

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <skippy.hammond@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'debug': 0.03; 'handler': 0.04; 'interpreter': 0.05; 'library,': 0.05; 'run,': 0.07; 'python': 0.08; 'scripts': 0.09; 'any.': 0.09; 'demonstrates': 0.09; "everyone's": 0.09; 'handlers': 0.09; 'relevant.': 0.09; 'spawn': 0.09; 'anyway': 0.09; 'debugger,': 0.16; 'from:name:mark hammond': 0.16; 'guessing': 0.16; 'module).': 0.16; 'pythonwin': 0.16; 'received:192.168.0.9': 0.16; 'reply-to:addr:mhammond': 0.16; 'reply-to:addr:skippinet.com.au': 0.16; 'richardson': 0.16; 'sajip': 0.16; 'subject:global': 0.16; 'subject:logging': 0.16; 'vinay': 0.16; 'cc:addr:python-list': 0.16; 'looked': 0.16; 'wrote:': 0.18; '>>>': 0.18; 'jan': 0.19; 'possibly': 0.19; 'cheers,': 0.20; 'cc:no real name:2**0': 0.21; 'header:In-Reply- To:1': 0.22; 'static': 0.24; 'times,': 0.24; '(like': 0.26; 'cc:2**0': 0.26; "i'm": 0.28; 'script': 0.28; '24,': 0.29; 'script.': 0.29; 'problem': 0.29; 'cc:addr:python.org': 0.29; 'seem': 0.29; 'pm,': 0.29; '"in': 0.30; 'ran': 0.30; 'received:209.85.210.46': 0.30; 'received:mail- pz0-f46.google.com': 0.30; "didn't": 0.30; 'message- id:@gmail.com': 0.31; 'change.': 0.32; 'does': 0.32; 'objects': 0.32; 'list': 0.32; "can't": 0.33; 'header:User-Agent:1': 0.33; 'it.': 0.33; 'message.': 0.33; 'file': 0.34; 'anything': 0.34; 'running': 0.34; 'here,': 0.35; 'probably': 0.35; 'google': 0.35; 'post': 0.36; 'run': 0.37; 'but': 0.37; 'received:google.com': 0.37; 'received:209.85': 0.38; 'received:192': 0.38; 'could': 0.38; 'difficult': 0.39; 'received:209': 0.39; "you'll": 0.61; 'more': 0.61; 'simple': 0.61; 'your': 0.61; 'talking': 0.62; 'our': 0.63; 'show': 0.66; 'header:Reply-To:1': 0.70; 'reply-to:no real name:2**0': 0.72; 'subject:long': 0.93
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=3k+bVt1CA15fvj1NkWiGwR8js2ZVOysgMY134A2T6Bw=; b=b9CqZxmJ8EI2mm0HTn4Zk8t3RybmktgsijFlUz/qj2HGh9oZPiZc4XYSYHslQUQTj4 01oGrg3eeyCx04JMvGbJMnemxI4GKT/CVWzywe/snntKqOhNrzpQuX7J9JLLkIVP9FVW 16uLnArDzTdY4d8r0H0KwcVaa5tHU6P0DVoVY=
Date Wed, 08 Feb 2012 10:04:29 +1100
From Mark Hammond <skippy.hammond@gmail.com>
User-Agent Mozilla/5.0 (Windows NT 6.0; WOW64; rv:12.0a2) Gecko/20120204 Thunderbird/12.0a2
MIME-Version 1.0
To Jean-Michel Pichavant <jeanmichel@sequans.com>
Subject Re: PythonWin debugger holds onto global logging objects too long
References <mailman.5026.1327416731.27778.python-list@python.org> <86ba1ef0-fe15-4404-a11e-8d762ca8b600@e27g2000vbu.googlegroups.com> <4F310164.3070606@sequans.com>
In-Reply-To <4F310164.3070606@sequans.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
Reply-To mhammond@skippinet.com.au
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5523.1328655882.27778.python-list@python.org> (permalink)
Lines 45
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1328655882 news.xs4all.nl 6962 [2001:888:2000:d::a6]:47316
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:19992

Show key headers only | View raw


On 7/02/2012 9:48 PM, Jean-Michel Pichavant wrote:
> Vinay Sajip wrote:
>> On Jan 24, 2:52 pm, Rob Richardson <RDRichard...@rad-con.com> wrote:
>>> I use PythonWin to debug the Python scripts we write. Our scripts
>>> often use the log2pyloggingpackage. When running the scripts inside
>>> the debugger, we seem to get oneloggingobject for every time we run
>>> the script. The result is that after running the script five times,
>>> the log file contains five copies of every message. The only way I
>>> know to clean this up and get only a single copy of each message is
>>> to close PythonWin and restart it.
>>>
>>> What do I have to do in my scripts to clean up theloggingobjects so
>>> that I never get more than one copy of each message in my log files?
>>>
>>
>> I don't know what log2py is - Google didn't show up anything that
>> looked relevant. If you're talking about the logging package in the
>> Python standard library, I may be able to help: but a simple script
>> that I ran in PythonWin didn't show any problems, so you'll probably
>> need to post a short script which demonstrates the problem when run in
>> PythonWin.
>>
>> Regards,
>>
>> Vinay Sajip
> Same here, can't find anything about log2py.
> Anyway it's possible that your pythonwin does not spawn a clean python
> interpreter for every run, keeping the same one.

That is what everyone's pythonwin does :)  It always works "in process" 
- not ideal, but also likely to not change.

Cheers,

Mark

>
> So you could possibly keep adding log handlers to your loggers because
> they may be static objects (like for the standard logging module).
> One solution would be to empty your logger handler list before adding any.
>
> I'm just guessing though, difficult to know without any info on log2py.
>
> JM

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

PythonWin debugger holds onto global logging objects too long Rob Richardson <RDRichardson@rad-con.com> - 2012-01-24 14:52 +0000
  Re: PythonWin debugger holds onto global logging objects too long Vinay Sajip <vinay_sajip@yahoo.co.uk> - 2012-02-04 09:09 -0800
    Re: PythonWin debugger holds onto global logging objects too long Jean-Michel Pichavant <jeanmichel@sequans.com> - 2012-02-07 11:48 +0100
    Re: PythonWin debugger holds onto global logging objects too long Mark Hammond <skippy.hammond@gmail.com> - 2012-02-08 10:04 +1100

csiph-web