New issue 21 by atsushi....@ayoko.net: photos.addTags() failed in _dopost()
http://code.google.com/p/flickrpy/issues/detail?id=21
Hello.
> What steps will reproduce the problem?
1. photo.addTags(["foo", "bar"])
> What is the expected output? What do you see instead?
I saw the following by debug = True
_dopost url
http://flickr.com/services/rest/?api_key=XXXX&method=flickr.photos.addTags&&auth_token=XXXX&api_sig=XXXX
_dopost payload photo_id=XXXX&method=flickr.photos.addTags&tags=foo%2Cbar
Traceback (most recent call last):
(snip)
File "flickr.py", line 188, in addTags
_dopost(method, auth=True, photo_id=self.id, tags=tags)
File "flickr.py", line 916, in _dopost
return _get_data(minidom.parse(urlopen(url, payload)))
File "flickr.py", line 931, in _get_data
raise FlickrError, msg
flickr.FlickrError: ERROR [112]:
Method "flickr.photos.addTagsflickr.photos.addTags" not found
> What version of the product are you using? On what operating system?
Downloaded on Jan. 25th, 2011.
__author__ = "James Clarke <ja...@jamesclarke.info>"
__version__ = "$Rev$"
__date__ = "$Date$"
__copyright__ = "Copyright: 2004-2010 James Clarke; Portions: 2007-2008
Joshua Henderson"
OS: Windows XP SP3 and Cygwin
Python 2.6.5
> Please provide any additional information below.
I've modified the code as below and now working. I'm not sure if it's
appropriate though.
In def _dopost(), (by diff -u)
params = _prepare_params(params)
- url = '%s%s/?api_key=%s&method=%s&%s'% \
- (HOST, API, API_KEY, method, _get_auth_url_suffix(method, auth,
params))
+ url = '%s%s/?api_key=%s%s'% \
+ (HOST, API, API_KEY, _get_auth_url_suffix(method, auth, params))
Thanks and Best Regards,
Atsushi Yokoyama
Comment #1 on issue 21 by vacari...@gmail.com: photos.addTags() failed in
_dopost()
http://code.google.com/p/flickrpy/issues/detail?id=21
It seems that the method is in the payload although it shouldn't be,
leading to the FlickrError. This would only happen if it somehow ended up
in the params, meaning that the function was called with the method as a
parameter.
I'll see if I can reproduce this error, and post back here.
Comment #2 on issue 21 by vacari...@gmail.com: photos.addTags() failed in
_dopost()
http://code.google.com/p/flickrpy/issues/detail?id=21
Problem confirmed and I added your fix to revision 50. I tested it and it
now works.
I don't understand why the method ends up in params, though...
Thank you for your investigation and fixing the issue.
I'm enjoying flickrpy!!
Regards,
Atsushi