~jflaker/duplicity/BugFix1325215

« back to all changes in this revision

Viewing changes to duplicity/backends/giobackend.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:
25
25
 
26
26
import duplicity.backend
27
27
from duplicity import log
 
28
from duplicity import util
28
29
 
29
30
def ensure_dbus():
30
31
    # GIO requires a dbus session bus which can start the gvfs daemons
103
104
            # check for NOT_SUPPORTED because some schemas (e.g. file://) validly don't
104
105
            if e.code != Gio.IOErrorEnum.ALREADY_MOUNTED and e.code != Gio.IOErrorEnum.NOT_SUPPORTED:
105
106
                log.FatalError(_("Connection failed, please check your password: %s")
106
 
                               % str(e), log.ErrorCode.connection_failed)
 
107
                               % util.uexc(e), log.ErrorCode.connection_failed)
107
108
        loop.quit()
108
109
 
109
110
    def __copy_progress(self, *args, **kwargs):