Issue 23 in flickrpy: Fix crash in 1-photo photosets

0 views
Skip to first unread message

flic...@googlecode.com

unread,
Apr 5, 2013, 4:30:18 PM4/5/13
to flickrp...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 23 by photosag...@gmail.com: Fix crash in 1-photo photosets
http://code.google.com/p/flickrpy/issues/detail?id=23

Photoset.getPhotos() raises an exception if there is exactly one photo in
the set:

Traceback (most recent call last):
File "./test_api.py", line 33, in <module>
test_photosets(stefano)
File "./test_api.py", line 17, in test_photosets
photos = photoset.getPhotos()
File "/home/artur/devel/flickrpy-devel/flickr.py", line 412, in getPhotos
for photo in photos:
TypeError: iteration over non-sequence

Attaching patch that fixes the issue.

Attachments:
0001-Fix-crash-in-1-photo-photosets.patch 1.1 KB

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

flic...@googlecode.com

unread,
Apr 6, 2013, 8:34:44 AM4/6/13
to flickrp...@googlegroups.com
Updates:
Owner: jims...@gmail.com

Comment #1 on issue 23 by jims...@gmail.com: Fix crash in 1-photo photosets
http://code.google.com/p/flickrpy/issues/detail?id=23

Thanks for the patch. Might be a bit clearer with something like:

try:
iter(photos)
except TypeError:
photos = [photos]

maybe?

flic...@googlecode.com

unread,
Apr 6, 2013, 9:10:40 AM4/6/13
to flickrp...@googlegroups.com
Updates:
Status: Fixed

Comment #2 on issue 23 by jims...@gmail.com: Fix crash in 1-photo photosets
http://code.google.com/p/flickrpy/issues/detail?id=23

Fixed. Thanks for the report!
Reply all
Reply to author
Forward
0 new messages