mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Linux binary install script: Fix error on linux systems where the system python has an encoding of None set on stdout. Assume encoding is utf-8 in this case.
This commit is contained in:
parent
0dc884efc5
commit
290462909f
@ -16,7 +16,7 @@ url = 'http://status.calibre-ebook.com/dist/linux'+('64' if is64bit else '32')
|
||||
signature_url = 'http://calibre-ebook.com/downloads/signatures/%s.sha512'
|
||||
url = os.environ.get('CALIBRE_INSTALLER_LOCAL_URL', url)
|
||||
py3 = sys.version_info[0] > 2
|
||||
enc = getattr(sys.stdout, 'encoding', 'UTF-8')
|
||||
enc = getattr(sys.stdout, 'encoding', 'UTF-8') or 'utf-8'
|
||||
calibre_version = signature = None
|
||||
urllib = __import__('urllib.request' if py3 else 'urllib', fromlist=1)
|
||||
if py3:
|
||||
@ -197,7 +197,7 @@ class ProgressBar:
|
||||
def prints(*args, **kwargs): # {{{
|
||||
f = kwargs.get('file', sys.stdout.buffer if py3 else sys.stdout)
|
||||
end = kwargs.get('end', b'\n')
|
||||
enc = getattr(f, 'encoding', 'utf-8')
|
||||
enc = getattr(f, 'encoding', 'utf-8') or 'utf-8'
|
||||
|
||||
if isinstance(end, unicode):
|
||||
end = end.encode(enc)
|
||||
|
Loading…
x
Reference in New Issue
Block a user