Closed greenpasta closed 7 years ago
Good find. We should be using method.__name__
instead of method.func_name
. Can you change the code and see if that solves things?
It does clear that error, but now gives me an issue with using parsed-json as the format. While I would prefer JSON, it's not the end of the world for me to use etree.
File "/usr/local/venv/myvenv/lib/python3.4/site-packages/flickrapi/core.py", line 96, in decorated
raise ValueError(msg % (method.__name__, self.default_format))
ValueError: Function walk_set requires that you use ElementTree ("etree") as the communication format, while the current format is set to "parsed-json".
This is documented ("Uses the ElementTree format, incompatible with other formats."), but I understand your fondness of JSON. As an alternative to switching your entire application to ElementTree, you could also extend FlickrAPI.data_walker()
so that it also supports JSON. If you do that, I'd suggest renaming the current function to _data_walker_etree()
and adding a _data_walker_json()
, and then turning data_walker()
into a function that calls either one of those depending on the configured format.
If you do this, please send it in as a pull request so that I can merge it into the FlickrAPI library.
Closing this ticket as the actual bug is fixed. Feel free to send in a pull request for JSON support in the walker functions.
I'm on Python 3.4.5 and the following code:
Gives this error: