Les sous-répertoires duplicity/backends et /usr/lib64/python2.7/site-packages/duplicity/backends sont identiques diff -u duplicity/collections.py /usr/lib64/python2.7/site-packages/duplicity/collections.py --- duplicity/collections.py 2013-08-08 11:15:50.659693242 +0200 +++ /usr/lib64/python2.7/site-packages/duplicity/collections.py 2013-08-07 23:26:04.170502856 +0200 @@ -611,7 +611,7 @@ return l - def __str__(self): + def __unicode__(self): """ Return string summary of the collection """ @@ -621,30 +621,30 @@ (self.backend.__class__.__name__,), _("Archive dir: %s") % (self.archive_dir.name,)] - l.append("\n" + - gettext.ngettext("Found %d secondary backup chain.", + l.append(u"\n" + + ngettext("Found %d secondary backup chain.", "Found %d secondary backup chains.", len(self.other_backup_chains)) % len(self.other_backup_chains)) for i in range(len(self.other_backup_chains)): l.append(_("Secondary chain %d of %d:") % (i+1, len(self.other_backup_chains))) - l.append(str(self.other_backup_chains[i])) + l.append(unicode(self.other_backup_chains[i])) l.append("") if self.matched_chain_pair: - l.append("\n" + _("Found primary backup chain with matching " + l.append(u"\n" + _("Found primary backup chain with matching " "signature chain:")) - l.append(str(self.matched_chain_pair[1])) + l.append(unicode(self.matched_chain_pair[1])) else: l.append(_("No backup chains with active signatures found")) if self.orphaned_backup_sets or self.incomplete_backup_sets: - l.append(gettext.ngettext("Also found %d backup set not part of any chain,", + l.append(ngettext("Also found %d backup set not part of any chain,", "Also found %d backup sets not part of any chain,", len(self.orphaned_backup_sets)) % (len(self.orphaned_backup_sets),)) - l.append(gettext.ngettext("and %d incomplete backup set.", + l.append(ngettext("and %d incomplete backup set.", "and %d incomplete backup sets.", len(self.incomplete_backup_sets)) % (len(self.incomplete_backup_sets),)) @@ -654,7 +654,7 @@ else: l.append(_("No orphaned or incomplete backup sets found.")) - return "\n".join(l) + return u"\n".join(l) def set_values(self, sig_chain_warning = 1): """ @@ -668,14 +668,14 @@ # get remote filename list backend_filename_list = self.backend.list() - log.Debug(gettext.ngettext("%d file exists on backend", + log.Debug(ngettext("%d file exists on backend", "%d files exist on backend", len(backend_filename_list)) % len(backend_filename_list)) # get local filename list local_filename_list = self.archive_dir.listdir() - log.Debug(gettext.ngettext("%d file exists in cache", + log.Debug(ngettext("%d file exists in cache", "%d files exist in cache", len(local_filename_list)) % len(local_filename_list)) @@ -750,7 +750,7 @@ assert self.values_set if self.local_orphaned_sig_names: - log.Warn(gettext.ngettext("Warning, found the following local orphaned " + log.Warn(ngettext("Warning, found the following local orphaned " "signature file:", "Warning, found the following local orphaned " "signature files:", @@ -759,7 +759,7 @@ log.WarningCode.orphaned_sig) if self.remote_orphaned_sig_names: - log.Warn(gettext.ngettext("Warning, found the following remote orphaned " + log.Warn(ngettext("Warning, found the following remote orphaned " "signature file:", "Warning, found the following remote orphaned " "signature files:", @@ -776,7 +776,7 @@ "from aborted session"), log.WarningCode.incomplete_backup) if self.orphaned_backup_sets: - log.Warn(gettext.ngettext("Warning, found the following orphaned " + log.Warn(ngettext("Warning, found the following orphaned " "backup file:", "Warning, found the following orphaned " "backup files:", diff -u duplicity/diffdir.py /usr/lib64/python2.7/site-packages/duplicity/diffdir.py --- duplicity/diffdir.py 2013-08-08 11:15:50.664693301 +0200 +++ /usr/lib64/python2.7/site-packages/duplicity/diffdir.py 2013-08-08 11:08:33.053332890 +0200 @@ -112,7 +112,11 @@ ti = new_path.get_tarinfo() index = new_path.index delta_path = new_path.get_ropath() - log.Debug(_("Getting delta of %s and %s") % (new_path, sig_path)) + if not isinstance(new_path, unicode): + new_pathu = str(new_path).decode('utf-8') + if not isinstance(sig_path, unicode): + sig_pathu = str(sig_path).decode('utf-8') + log.Debug(_("Getting delta of %s and %s") % (new_pathu, sig_pathu)) def callback(sig_string): """ @@ -157,10 +161,11 @@ if delta_path.difftype == "snapshot": if new_path and stats: stats.add_new_file(new_path) + path = delta_path.get_relative_path().decode('utf-8') log.Info(_("A %s") % - (delta_path.get_relative_path(),), + (path,), log.InfoCode.diff_file_new, - util.escape(delta_path.get_relative_path())) + util.escape(delta_path.get_relative_path()).decode('utf-8')) else: if new_path and stats: stats.add_changed_file(new_path) diff -u duplicity/__init__.py /usr/lib64/python2.7/site-packages/duplicity/__init__.py --- duplicity/__init__.py 2013-08-08 11:15:50.648693111 +0200 +++ /usr/lib64/python2.7/site-packages/duplicity/__init__.py 2013-08-07 23:20:59.716631994 +0200 @@ -20,4 +20,4 @@ # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import gettext -gettext.install('duplicity', codeset='utf8') +gettext.install('duplicity', codeset='utf8', unicode=True, names='ngettext') diff -u duplicity/log.py /usr/lib64/python2.7/site-packages/duplicity/log.py --- duplicity/log.py 2013-08-08 11:15:50.672693396 +0200 +++ /usr/lib64/python2.7/site-packages/duplicity/log.py 2013-08-08 10:09:18.279335130 +0200 @@ -71,7 +71,7 @@ initial_level = _logger.getEffectiveLevel() _logger.setLevel(DupToLoggerLevel(MAX)) - _logger.log(DupToLoggerLevel(verb_level), s.decode("utf8", "ignore")) + _logger.log(DupToLoggerLevel(verb_level), s) _logger.controlLine = None if force_print: @@ -115,8 +115,8 @@ def PrintCollectionStatus(col_stats, force_print=False): """Prints a collection status to the log""" - Log(str(col_stats), 8, InfoCode.collection_status, - '\n' + '\n'.join(col_stats.to_log_info()), force_print) + Log(unicode(col_stats), 8, InfoCode.collection_status, + u'\n' + u'\n'.join(col_stats.to_log_info()), force_print) def Notice(s): """Shortcut used for notice messages (verbosity 3, the default).""" diff -u duplicity/selection.py /usr/lib64/python2.7/site-packages/duplicity/selection.py --- duplicity/selection.py 2013-08-08 11:15:50.683693526 +0200 +++ /usr/lib64/python2.7/site-packages/duplicity/selection.py 2013-08-08 11:16:54.390448043 +0200 @@ -184,7 +184,11 @@ log.Log(_("Selecting %s") % delayed_path.name, 6) yield delayed_path del delayed_path_stack[:] - log.Debug(_("Selecting %s") % subpath.name) + if isinstance(subpath.name, unicode): + filename = subpath.name + else: + filename = subpath.name.decode('utf-8') + log.Debug(_("Selecting %s") % filename) yield subpath if subpath.isdir(): diryield_stack.append(diryield(subpath))