mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix regression in 0.8.32 that broke deleting some books with non ascii characters in the title/author. Fixes #908068 (Error deleting ebooks with utf8 encode (calibre 0.8.32-linux))
This commit is contained in:
parent
ad86b2bc00
commit
cb4ec8cd39
@ -36,6 +36,11 @@ uid = os.getuid()
|
||||
TOPDIR_TRASH = '.Trash'
|
||||
TOPDIR_FALLBACK = '.Trash-%s'%uid
|
||||
|
||||
def uniquote(raw):
|
||||
if isinstance(raw, unicode):
|
||||
raw = raw.encode('utf-8')
|
||||
return quote(raw).decode('utf-8')
|
||||
|
||||
def is_parent(parent, path):
|
||||
path = op.realpath(path) # In case it's a symlink
|
||||
parent = op.realpath(parent)
|
||||
@ -53,7 +58,7 @@ def info_for(src, topdir):
|
||||
src = op.relpath(src, topdir)
|
||||
|
||||
info = "[Trash Info]\n"
|
||||
info += "Path=" + quote(src) + "\n"
|
||||
info += "Path=" + uniquote(src) + "\n"
|
||||
info += "DeletionDate=" + format_date(datetime.now()) + "\n"
|
||||
return info
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user