From 69d2e0de21c6de8c5ab17fdc67b99bce8aab9752 Mon Sep 17 00:00:00 2001 From: owsla Date: Tue, 22 Jul 2008 17:46:59 +0000 Subject: Fall back on the Python make_file_dict function when the filename contains non-ASCII characters. git-svn-id: http://svn.savannah.nongnu.org/svn/rdiff-backup/trunk@918 2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109 --- rdiff-backup/rdiff_backup/rpath.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'rdiff-backup/rdiff_backup/rpath.py') diff --git a/rdiff-backup/rdiff_backup/rpath.py b/rdiff-backup/rdiff_backup/rpath.py index ec276d4..0dadd43 100644 --- a/rdiff-backup/rdiff_backup/rpath.py +++ b/rdiff-backup/rdiff_backup/rpath.py @@ -273,9 +273,14 @@ def make_file_dict(filename): (incomplete) rpath object. """ if os.name != 'nt': - return C.make_file_dict(filename) - else: - return make_file_dict_python(filename) + try: + return C.make_file_dict(filename) + except OSError, error: + # Unicode filenames should be process by the Python version + if error.errno != errno.EILSEQ and error.errno != errno.EINVAL: + raise + + return make_file_dict_python(filename) def make_file_dict_python(filename): """Create the data dictionary using a Python call to os.lstat -- cgit v1.2.1