mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-25 08:03:01 +02: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
1 changed files with 8 additions and 2 deletions
|
|
@ -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…
Reference in a new issue