Duplicate log output when installing dependencies
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grok |
Fix Released
|
Low
|
Uli Fouquet |
Bug Description
When running "grokproject Sample" from the tutorial, I get some lines duplicated in the output, as follows:
> Installing eggbasket.
> Getting distribution for 'zope.app.
> eggbasket: Distributions are not installed. A tarball will be downloaded.
> eggbasket: Distributions are not installed. A tarball will be downloaded.
> eggbasket: Downloading http://
> eggbasket: Downloading http://
> eggbasket: Finished downloading.
> eggbasket: Finished downloading.
> eggbasket: Extracting tarball contents...
> eggbasket: Extracting tarball contents...
> eggbasket: No correct tarball found at http://
> s-1.0a1.tgz.
> eggbasket: No correct tarball found at http://
> s-1.0a1.tgz.
> eggbasket: The error was: bad checksum
> eggbasket: The error was: bad checksum
It seems to be just the "eggbasket" lines. If anyone could direct me to where these lines come from, I might be able to create a patch.
Oh, and I'm on Windows XP with Python 2.6.
description: | updated |
This bug is independent from the used OS. It is already described here:
https:/ /bugs.launchpad .net/zc. buildout/ +bug/125729
where Jim Fulton says, that he won't fix the bug in zc.buildout.
There is, however, the possibility to work around by tearing down the already created loggers before creating new ones. This is for example done in grokproject (before that we had doubles for every line of grokproject output and eggbasket output was displayed even three times!).
The fix could look like this (here taken from grokproject/ utils.py) ::
def remove_ old_logger_ handlers( ): manager. loggerDict. keys(): getLogger( 'zc.buildout' )
logger. removeHandler( handler)
# zc.buildout installs a new log stream on every call of
# main(). We remove any leftover handlers to avoid multiple output
# of same content (doubled lines etc.)
root_logger = logging.getLogger()
if 'zc.buildout' in root_logger.
logger = logging.
for handler in logger.handlers:
return
but had to be done at the appropriate places in z3c.recipe. eggbasket.
Alex, please tell, if you want to fix this, otherwise I'll do it.