Skip to content Skip to sidebar Skip to footer

Attributeerror: 'tuple' Object Has No Attribute 'read'

I have got this code's lines: import dropbox #some lines for initialize API's download = self.client.get_file_and_metadata(selected_path) current_working = os.getcwd() out = open

Solution 1:

Function get_file_and_metadata returns tuple: file and metadata.

from here: https://www.dropbox.com/developers/core/start/python

In addition to the file, the method also returns the file's metadata at its current revision. Every time a change is made to the file, the rev field of the file's metadata changes as well. By saving the revision when you download the file, you'll be able to tell if that file has been updated by another computer or device and choose to download the newer revision of that file.

change your call to self.client.get_file_and_metadata like this:

download, metadata = self.client.get_file_and_metadata(selected_path)

or just use get_file if you dont need the metadata:

download = self.client.get_file(selected_path)

Post a Comment for "Attributeerror: 'tuple' Object Has No Attribute 'read'"