greenscar / gdata-python-client

Automatically exported from code.google.com/p/gdata-python-client
0 stars 0 forks source link

Picasaweb InsertAlbum Error #184

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. use web application client authentication
2. (picasaweb) gd_client.InsertAlbum
3. got exception

What is the expected output? What do you see instead?
The album should be create

What version of the product are you using?
svn version

Please provide any additional information below.
I suggest in trunk/src/gdata/photos/service.py line 358, change the code:

    try:
      return self.Post(album, uri=self.userUri % self.email,
      converter=gdata.photos.AlbumEntryFromString)
    except gdata.service.RequestError, e:
      raise GooglePhotosException(e.args[0])

to:

    try:
      return self.Post(album, uri=self.userUri % 'default',
      converter=gdata.photos.AlbumEntryFromString)
    except gdata.service.RequestError, e:
      raise GooglePhotosException(e.args[0])

because if we don't use username and password login, self.email will be None.

InsertAlbum will be always the action to my own account, change it to
'defalut' will work for both kind of authentication.

Original issue reported on code.google.com by kernel1...@gmail.com on 5 Nov 2008 at 8:52

GoogleCodeExporter commented 9 years ago
'default' would be incorrect in cases where an email address is specified. 
Instead I
propose:

...uri=self.userUri % (self.email or 'default'),...

Original comment by api.jscu...@gmail.com on 5 Nov 2008 at 7:59

GoogleCodeExporter commented 9 years ago

Original comment by jscud.w...@gmail.com on 3 Feb 2009 at 6:54

GoogleCodeExporter commented 9 years ago
This issue has a workaround initialize the service class with email attribute
pws = gdata.photos.service.PhotosService(email="the_user_email")

Original comment by juhapekk...@gmail.com on 10 Oct 2009 at 11:31

GoogleCodeExporter commented 9 years ago

Original comment by afs...@google.com on 7 Oct 2011 at 12:19