mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix regression that broke recursive adding on windows with non ascii file paths
This commit is contained in:
parent
7178234279
commit
c8ca1afe70
@ -43,12 +43,8 @@ class RecursiveFind(QThread):
|
|||||||
self.single_book_per_directory = single
|
self.single_book_per_directory = single
|
||||||
self.canceled = False
|
self.canceled = False
|
||||||
|
|
||||||
def run(self):
|
def walk(self, root):
|
||||||
root = os.path.abspath(self.path)
|
|
||||||
self.books = []
|
self.books = []
|
||||||
if isinstance(root, unicode):
|
|
||||||
root = root.encode(filesystem_encoding)
|
|
||||||
try:
|
|
||||||
for dirpath in os.walk(root):
|
for dirpath in os.walk(root):
|
||||||
if self.canceled:
|
if self.canceled:
|
||||||
return
|
return
|
||||||
@ -56,6 +52,16 @@ class RecursiveFind(QThread):
|
|||||||
_('Searching in')+' '+dirpath[0])
|
_('Searching in')+' '+dirpath[0])
|
||||||
self.books += list(self.db.find_books_in_directory(dirpath[0],
|
self.books += list(self.db.find_books_in_directory(dirpath[0],
|
||||||
self.single_book_per_directory))
|
self.single_book_per_directory))
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
root = os.path.abspath(self.path)
|
||||||
|
try:
|
||||||
|
self.walk(root)
|
||||||
|
except:
|
||||||
|
try:
|
||||||
|
if isinstance(root, unicode):
|
||||||
|
root = root.encode(filesystem_encoding)
|
||||||
|
self.walk(root)
|
||||||
except Exception, err:
|
except Exception, err:
|
||||||
import traceback
|
import traceback
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user