]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
CLI: allow Unicode patterns in exclude option to 'tahoe backup'.
authordavid-sarah <david-sarah@jacaranda.org>
Thu, 17 Jun 2010 03:39:01 +0000 (20:39 -0700)
committerdavid-sarah <david-sarah@jacaranda.org>
Thu, 17 Jun 2010 03:39:01 +0000 (20:39 -0700)
src/allmydata/scripts/cli.py
src/allmydata/scripts/tahoe_backup.py

index 9f440b029b560455f0bfbf285cbe1fe5b75c0dae..afef264b195f79f51b5fa4ec3377ff19f47192fa 100644 (file)
@@ -295,14 +295,14 @@ class BackupOptions(VDriveOptions):
     def opt_exclude(self, pattern):
         """Ignore files matching a glob pattern. You may give multiple
         '--exclude' options."""
-        g = pattern.strip()
+        g = argv_to_unicode(pattern).strip()
         if g:
             exclude = self['exclude']
             exclude.add(g)
 
     def opt_exclude_from(self, filepath):
         """Ignore file matching glob patterns listed in file, one per
-        line."""
+        line. The file is assumed to be in the argv encoding."""
         try:
             exclude_file = file(filepath)
         except:
index e332b9f5caa99e462718e285da637ad9a0b047a4..8b853c9e7c6825f1855afeb06a0e581907309fac 100644 (file)
@@ -173,8 +173,8 @@ class BackerUpper:
             children = []
 
         for child in self.options.filter_listdir(children):
+            assert isinstance(child, unicode), child
             childpath = os.path.join(localpath, child)
-            child = unicode(child)
             # note: symlinks to directories are both islink() and isdir()
             if os.path.isdir(childpath) and not os.path.islink(childpath):
                 metadata = get_local_metadata(childpath)