Comment 11 for bug 1833685

Revision history for this message
Charles Celerier (chckyn) wrote :

I'm not sure this it the same bug, but I get the same AttributeError when I run duplicity with expired AWS credentials. I just ran `python setup.py tests` and saw all but one of the `testing/unit/test_diffdir.py` tests fail. I am running from revision 1401. Here is one of the failed tests.

```
____________________________________________________________ DDTest.test_diff ____________________________________________________________

self = <testing.unit.test_diffdir.DDTest testMethod=test_diff>

    def test_diff(self):
        u"""Test making a diff"""
        sel1 = selection.Select(Path(u"testfiles/dir1"))
        diffdir.write_block_iter(diffdir.SigTarBlockIter(sel1.set_iter()),
> u"testfiles/output/dir1.sigtar")

unit/test_diffdir.py:113:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../duplicity/diffdir.py:747: in write_block_iter
    for block in block_iter:
../duplicity/diffdir.py:542: in __next__
    result = self.process(next(self.input_iter)) # pylint: disable=assignment-from-no-return
../duplicity/diffdir.py:644: in process
    return self.tarinfo2tarblock(path.index, ti)
../duplicity/diffdir.py:503: in tarinfo2tarblock
    headers = tarinfo.tobuf(errors=u'replace', encoding=globals.fsencoding)
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tarfile.py:816: in tobuf
    return self.create_gnu_header(info, encoding, errors)
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tarfile.py:847: in create_gnu_header
    return buf + self._create_header(info, GNU_FORMAT, encoding, errors)
/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tarfile.py:937: in _create_header
    stn(info.get("gname", ""), 32, encoding, errors),
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

s = b'', length = 32, encoding = 'utf-8', errors = 'replace'

    def stn(s, length, encoding, errors):
        """Convert a string to a null-terminated bytes object.
        """
> s = s.encode(encoding, errors)
E AttributeError: 'bytes' object has no attribute 'encode'
```

Not really what to make of this other than to ensure my AWS credentials don't expire before I run my backups.