mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #913054 (doesn't start up when an unrelated *.po file exists in the users home directory)
This commit is contained in:
parent
6245be5f48
commit
34fbeef2a3
@ -74,8 +74,14 @@ def set_translators():
|
||||
if mpath and os.access(mpath+'.po', os.R_OK):
|
||||
from calibre.translations.msgfmt import make
|
||||
buf = cStringIO.StringIO()
|
||||
make(mpath+'.po', buf)
|
||||
buf = cStringIO.StringIO(buf.getvalue())
|
||||
try:
|
||||
make(mpath+'.po', buf)
|
||||
except:
|
||||
print (('Failed to compile translations file: %s,'
|
||||
' ignoring')%(mpath+'.po'))
|
||||
buf = None
|
||||
else:
|
||||
buf = cStringIO.StringIO(buf.getvalue())
|
||||
|
||||
if mpath is not None:
|
||||
from zipfile import ZipFile
|
||||
|
Loading…
x
Reference in New Issue
Block a user