NameError: global name 'Dropbox' is not defined

Bug #1795227 reported by Pedro Gimeno on 2018-09-30
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

Using the current head (1334 at the time of writing), I'm getting an exception when trying to backup using the dpbx scheme:

Traceback (innermost last):
  File "./", line 1668, in <module>
  File "./", line 1654, in with_tempdir
  File "./", line 1488, in main
    action = commandline.ProcessCommandLine(sys.argv[1:])
  File "<redacted>/duplicity/", line 1180, in ProcessCommandLine
    backup, local_pathname = set_backend(args[0], args[1])
  File "<redacted>/duplicity/", line 1051, in set_backend
    globals.backend = backend.get_backend(bend)
  File "<redacted>/duplicity/", line 223, in get_backend
    obj = get_backend_object(url_string)
  File "<redacted>/duplicity/", line 209, in get_backend_object
    return factory(pu)
  File "<redacted>/duplicity/backends/", line 110, in __init__
  File "<redacted>/duplicity/backends/", line 163, in login
    self.api_client = Dropbox(self.load_access_token())
 NameError: global name 'Dropbox' is not defined

The problem was introduced with the removal of the globals in revision 1297:

Re-adding the globals makes the problem disappear. I have NOT checked other backends modified in the same revision for similar problems, so it's possible that others are affected.

Pedro Gimeno (pgimeno) wrote :

For clarity, I've attached a patch that reverts the removal of the globals.

Without this patch, the imported identifiers are local to the __init__() constructor where the import statements are, and the rest of the code can't use them.

Changed in duplicity:
importance: Undecided → Medium
milestone: none → 0.8.00
status: New → Fix Committed
Changed in duplicity:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers