Bugs: Browse | Submit New | Admin

[#12672] Flickr sometimes returns out of range dates, crashing the calling program

Date:
2007-07-29 21:30
Priority:
3
Submitted By:
Joshua Jackson (pturing)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
Flickr sometimes returns out of range dates, crashing the calling program

Detailed description
For example, currently this will crash:

f = Flickr.new('/tmp/flickr-cache', KEY, SECRET)
f.people.getInfo("97644214@N00")



because this user's firstdate is in 1864, and though Parsedate will handle this Time will not, at least not on my system
- ruby 1.8.5



I'm currently working around this by changing base.rb like so:

  if (ParseDate.parsedate(tstr)[0] > 1901)
    p.photos_firstdatetaken = Time.gm(*ParseDate.parsedate(tstr)) if tstr
  end

but there ought to be a better way

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item