mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 20:35:18 +02:00
calibredb list: Fix incorrect output when redirecting to file
py3 compat, caused by mix of text and binary output streams.
This commit is contained in:
parent
bd9f294318
commit
78a001b335
1 changed files with 1 additions and 2 deletions
|
|
@ -8,7 +8,6 @@
|
|||
import sys
|
||||
from textwrap import TextWrapper
|
||||
|
||||
from calibre import prints
|
||||
from calibre.db.cli.utils import str_width
|
||||
from calibre.ebooks.metadata import authors_to_string
|
||||
from calibre.utils.date import isoformat
|
||||
|
|
@ -201,7 +200,7 @@ def do_list(
|
|||
fields
|
||||
)
|
||||
with ColoredStream(sys.stdout, fg='green'):
|
||||
prints(''.join(titles))
|
||||
print(''.join(titles), flush=True)
|
||||
stdout = getattr(sys.stdout, 'buffer', sys.stdout)
|
||||
linesep = as_bytes(os.linesep)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue