From 28b649dec99c6d7b8ac1665a0ec4d020b187e37d Mon Sep 17 00:00:00 2001 From: Markus Unterwaditzer Date: Wed, 18 Jun 2014 20:22:21 +0200 Subject: [PATCH] Don't use click's newline echoing click.echo does two write calls, which get flushed immediately. Using this in multiprocessing might make output overlap. Using a single write-call apparently resolves that issue, although i don't know why. A proper solution would be to use locks, but e.g. multiprocessing's logger doesn't seem have nearly as much flexibility as others. For now it seems to be bugfree enough. --- vdirsyncer/log.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vdirsyncer/log.py b/vdirsyncer/log.py index 42a2d38..2ee0e87 100644 --- a/vdirsyncer/log.py +++ b/vdirsyncer/log.py @@ -32,7 +32,7 @@ class ColorFormatter(logging.Formatter): class ClickStream(object): def write(self, string): - click.echo(string.rstrip()) + click.echo(string, nl=False) stdout_handler = logging.StreamHandler(ClickStream())