How to fix «/usr/lib64/python2.7/site-packages/duplicity/util.py:79: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6» in Duplicity?

I have replaced my /usr/lib64/python2.7/site-packages/duplicity/util.py with the latest version: github.com/henrysher/duplicity/blob/ef6d0f4b/duplicity/util.py, and then added the following method to it:

def ufn(filename):
    "Convert a (bytes) filename to unicode for printing"
    assert not isinstance(filename, unicode)
    return filename.decode(globals.fsencoding, 'replace')