pyicloud: TypeError: 'dict_values' object does not support indexing

Adam Funk a24061 at ducksburg.com
Fri Sep 30 09:23:12 EDT 2016


I'm trying to use pyicloud in idle3 (installed by pip3 on Ubuntu).

<https://github.com/picklepete/pyicloud>

The basic stuff works, but access to photos (following the
instructions) fails:


>>> photos = api.photos.all
>>> for photo in photos:
    print(photo.filename)


Traceback (most recent call last):
  File "<pyshell#37>", line 2, in <module>
      print(photo.filename)
        File
  "/usr/local/lib/python3.5/dist-packages/pyicloud/services/photos.py",
  line 242, in filename
      return self.data['details'].get('filename')
        File
  "/usr/local/lib/python3.5/dist-packages/pyicloud/services/photos.py",
  line 237, in data
      self._data = self.album._fetch_asset_data_for(self)
        File
  "/usr/local/lib/python3.5/dist-packages/pyicloud/services/photos.py",
  line 203, in _fetch_asset_data_for
      client_ids.append(self._photo_assets[index].client_id)
      TypeError: 'dict_values' object does not support indexing

which points at this bit of the source code

240    @property
241    def filename(self):
242        return self.data['details'].get('filename')
		
And I get the same exception trying to do anything with a single
photo.  Is this code not really Python 3 compatible?  Or am I doing
something stupid?

Thanks,
Adam


-- 
A firm rule must be imposed upon our nation before it destroys
itself. The United States needs some theology and geometry, some taste
and decency. I suspect that we are teetering on the edge of the abyss.
                                                 --- Ignatius J Reilly



More information about the Python-list mailing list