mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-21 08:33:11 +02:00
Edit Book: Fix saving of empty files not working
This commit is contained in:
parent
5c2dec8022
commit
77e79d75cb
1 changed files with 5 additions and 2 deletions
|
|
@ -81,8 +81,11 @@ def toPlainText(self):
|
|||
if hasattr(ans, 'rstrip'):
|
||||
ans = ans.rstrip('\0')
|
||||
else: # QString
|
||||
while ans[-1] == '\0':
|
||||
ans.chop(1)
|
||||
try:
|
||||
while ans[-1] == '\0':
|
||||
ans.chop(1)
|
||||
except IndexError:
|
||||
pass # ans is an empty string
|
||||
return ans
|
||||
|
||||
@pyqtSlot()
|
||||
|
|
|
|||
Loading…
Reference in a new issue