mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Fix #134.
This commit is contained in:
parent
fb2a358c73
commit
6650029e89
@ -42,11 +42,14 @@ def generate_html(rtfpath):
|
||||
cmd = ' '.join([UNRTF, '"'+rtfpath+'"'])
|
||||
p = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
|
||||
file.write(p.stdout.read())
|
||||
file.close()
|
||||
ret = p.wait()
|
||||
if ret != 0:
|
||||
if isosx and ret == -11: #unrtf segfaults on OSX but seems to convert most of the file.
|
||||
file.write('</body>\n</html>')
|
||||
else:
|
||||
raise ConversionError, 'unrtf failed with error code: %d'%(ret,)
|
||||
print 'done'
|
||||
file.close()
|
||||
return path
|
||||
finally:
|
||||
os.chdir(cwd)
|
||||
|
Loading…
x
Reference in New Issue
Block a user