~jflaker/duplicity/BugFix1325215

« back to all changes in this revision

Viewing changes to duplicity/backend.py

  • Committer: Kenneth Loafman
  • Date: 2014-04-30 11:37:10 UTC
  • mfrom: (981.1.1 encode)
  • Revision ID: kenneth@loafman.com-20140430113710-cs51mjoz1j5ybjys
* Merged in lp:~mterry/duplicity/encode-exceptions
  - Because exceptions often contain file paths, they have the same problem
    with Python 2.x's implicit decoding using the 'ascii' encoding that we've
    experienced before.  So I added a new util.uexc() method that uses the
    util.ufn() method to convert an exception to a unicode string and used it
    around the place.
  - Bugs fixed: 1289288, 1311176, 1313966

Show diffs side-by-side

added added

removed removed

Lines of Context:
383
383
                        extra = ' '.join([operation] + [make_filename(x) for x in args if x])
384
384
                        log.FatalError(_("Giving up after %s attempts. %s: %s")
385
385
                                       % (n, e.__class__.__name__,
386
 
                                          str(e)), code=code, extra=extra)
 
386
                                          util.uexc(e)), code=code, extra=extra)
387
387
                    else:
388
388
                        log.Warn(_("Attempt %s failed. %s: %s")
389
 
                                 % (n, e.__class__.__name__, str(e)))
 
389
                                 % (n, e.__class__.__name__, util.uexc(e)))
390
390
                    if not at_end:
391
391
                        if isinstance(e, TemporaryLoadException):
392
392
                            time.sleep(90) # wait longer before trying again
495
495
 
496
496
    def __do_put(self, source_path, remote_filename):
497
497
        if hasattr(self.backend, '_put'):
498
 
            log.Info(_("Writing %s") % remote_filename)
 
498
            log.Info(_("Writing %s") % util.ufn(remote_filename))
499
499
            self.backend._put(source_path, remote_filename)
500
500
        else:
501
501
            raise NotImplementedError()