mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 20:35:18 +02:00
py3: All tests in srv module now pass
This commit is contained in:
parent
0f4e37dfca
commit
976a3f9b4a
1 changed files with 5 additions and 1 deletions
|
|
@ -22,6 +22,7 @@
|
|||
from polyglot.builtins import iteritems, map, range
|
||||
from polyglot import reprlib
|
||||
from polyglot.http_cookie import SimpleCookie
|
||||
from polyglot.builtins import unicode_type
|
||||
from polyglot.urllib import parse_qs, quote as urlquote
|
||||
from polyglot.binary import as_hex_unicode as encode_name, from_hex_unicode as decode_name
|
||||
|
||||
|
|
@ -336,9 +337,12 @@ def prints(self, level, *args, **kwargs):
|
|||
kwargs['safe_encode'] = True
|
||||
kwargs['file'] = self.stream
|
||||
self.current_pos += prints(*args, **kwargs)
|
||||
if iswindows:
|
||||
if iswindows or ispy3:
|
||||
# For some reason line buffering does not work on windows
|
||||
# and in python 3 it only works with text mode streams
|
||||
end = kwargs.get('end', b'\n')
|
||||
if isinstance(end, unicode_type):
|
||||
end = end.encode('utf-8')
|
||||
if b'\n' in end:
|
||||
self.flush()
|
||||
self.rollover()
|
||||
|
|
|
|||
Loading…
Reference in a new issue