Public bug reported:

Hello, despite I have never written anything in Python, it looks like
the problem is some automatic code "conversion" to make this "duplicity"
backend work with Python 3, or a similar issue, if the fundamental issue
is another please ignore and stick to the facts below, thank you.

After upgrading from Ubuntu 18.04 LTS to 20.04 LTS, my "duplicity"-based backup 
to offsite MEGA.nz stopped working. This is what I was getting as a result 
(output shown for a fresh new test backup):
"""
export BACKUP_SOURCE="/tmp"
export BACKUP_DESTINATION="mega://[email protected]@mega.co.nz/Test_2"

# duplicity --full-if-older-than 30D ${BACKUP_SOURCE} ${BACKUP_DESTINATION}
mkdir: Test_2
megals: /Root/Test_2
Attempt 1 failed. TypeError: a bytes-like object is required, not 'str'
megals: /Root/Test_2
Attempt 2 failed. TypeError: a bytes-like object is required, not 'str'
megals: /Root/Test_2
Attempt 3 failed. TypeError: a bytes-like object is required, not 'str'
megals: /Root/Test_2
Attempt 4 failed. TypeError: a bytes-like object is required, not 'str'
megals: /Root/Test_2
Giving up after 5 attempts. TypeError: a bytes-like object is required, not 
'str'
mkdir: Test_2
megals: /Root/Test_2
Attempt 1 failed. TypeError: a bytes-like object is required, not 'str'
megals: /Root/Test_2
Attempt 2 failed. TypeError: a bytes-like object is required, not 'str'
megals: /Root/Test_2
Attempt 3 failed. TypeError: a bytes-like object is required, not 'str'
"""

After some research found out some calls to Python were being given a
byte-like object instead of strings (str). So googled around and added
some ".decode()" calls at some points in which strings were expected
(some trial and error seeing all similar errors in the MEGA.nz backend
data flow. After doing so, the backend resumed working normally
(resulting patch against current "duplicity" package is attached). So
please make a good patch from the one attached as reference and please
make its way into the Ubuntu package ASAP (don't know if upstream
version is affected as well).

More details about my current system:
"""
#  lsb_release -rd
Description:    Ubuntu 20.04 LTS
Release:        20.04

# apt-cache policy duplicity
duplicity:
  Instalados: 0.8.11.1612-1
  Candidato:  0.8.11.1612-1
  Tabla de versión:
 *** 0.8.11.1612-1 500
        500 http://es.archive.ubuntu.com/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status
"""

Hope you find this valuable.

** Affects: duplicity (Ubuntu)
     Importance: Undecided
         Status: New

** Patch added: "Tentative patch to fix current "duplicity" MEGA.nz backend 
issue with bytes / string objects"
   
https://bugs.launchpad.net/bugs/1876778/+attachment/5366372/+files/duplicity_20.04_megabackend.diff

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1876778

Title:
  MEGA.nz backend issues after "conversion" to Python 3 (patch attached)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/duplicity/+bug/1876778/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to