summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-07-22 17:46:59 +0000
committerowsla <owsla@2b77aa54-bcbc-44c9-a7ec-4f6cf2b41109>2008-07-22 17:46:59 +0000
commit69d2e0de21c6de8c5ab17fdc67b99bce8aab9752 (patch)
treed1ddee83b6c83401a63a0be72da28b1f5406a333
parentf3bf53dd18ab9fd3c1fe265dfaab7c381226a189 (diff)
downloadrdiff-backup-69d2e0de21c6de8c5ab17fdc67b99bce8aab9752.tar.gz
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
-rw-r--r--rdiff-backup/CHANGELOG3
-rw-r--r--rdiff-backup/rdiff_backup/rpath.py11
2 files changed, 11 insertions, 3 deletions
diff --git a/rdiff-backup/CHANGELOG b/rdiff-backup/CHANGELOG
index 9821b2b..5398ced 100644
--- a/rdiff-backup/CHANGELOG
+++ b/rdiff-backup/CHANGELOG
@@ -1,6 +1,9 @@
New in v1.1.18 (????/??/??)
---------------------------
+Fall back on the Python make_file_dict function when the filename contains
+non-ASCII characters. (Andrew Ferguson)
+
Ignore Extended Attributes which have Unicode characters outside the current
system representation. These will be correctly handled when rdiff-backup
switches to Python 3, which will have full Unicode support. (Andrew Ferguson)
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