NameError: global name 'Dropbox' is not defined
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Duplicity |
Fix Released
|
Medium
|
Unassigned |
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 "./duplicity.py", line 1668, in <module>
with_
File "./duplicity.py", line 1654, in with_tempdir
fn()
File "./duplicity.py", line 1488, in main
action = commandline.
File "<redacted>
backup, local_pathname = set_backend(
File "<redacted>
globals.backend = backend.
File "<redacted>
obj = get_backend_
File "<redacted>
return factory(pu)
File "<redacted>
self.login()
File "<redacted>
self.api_client = Dropbox(
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.
Changed in duplicity: | |
importance: | Undecided → Medium |
milestone: | none → 0.8.00 |
status: | New → Fix Committed |
Changed in duplicity: | |
status: | Fix Committed → Fix Released |
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.