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):
|
if mpath and os.access(mpath+'.po', os.R_OK):
|
||||||
from calibre.translations.msgfmt import make
|
from calibre.translations.msgfmt import make
|
||||||
buf = cStringIO.StringIO()
|
buf = cStringIO.StringIO()
|
||||||
make(mpath+'.po', buf)
|
try:
|
||||||
buf = cStringIO.StringIO(buf.getvalue())
|
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:
|
if mpath is not None:
|
||||||
from zipfile import ZipFile
|
from zipfile import ZipFile
|
||||||
|
Loading…
x
Reference in New Issue
Block a user