From 5f3d3b2ef89f749da9e39e8d83e54d5c9a83a71c Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 6 Feb 2020 06:37:34 +0530 Subject: [PATCH] ... --- src/calibre/gui2/device.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/device.py b/src/calibre/gui2/device.py index 9ed18d5a84..6c1fa0c4fb 100644 --- a/src/calibre/gui2/device.py +++ b/src/calibre/gui2/device.py @@ -1771,7 +1771,10 @@ class DeviceMixin(object): # {{{ string_pat = re.compile(r'(?u)\W|[_]') def clean_string(x): - x = x.lower() if x else '' + try: + x = x.lower() if x else '' + except Exception: + x = '' return string_pat.sub('', x) update_metadata = (