forecasts.full_text_forecast breaks from timezone issues

Bug #334752 reported by Sean Stoops
2
Affects Status Importance Assigned to Milestone
Python Earth
New
High
Unassigned

Bug Description

In [4]: forecasts.full_text_forecast('ks','009')
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)

/Users/brutimus/<ipython console> in <module>()

/Users/brutimus/temp/python-earth-brutimus/earth/weather/forecasts.py in full_text_forecast(state_abbr, zone)
    846 expires = datetime(int(dl[8:12]), int(dl[12:14]), int(dl[14:16]),
    847 int(dl[16:18]), int(dl[18:20]))
--> 848 issued = datetime.strptime(forecast[5], "%I%M %p %Z %a %b %d %Y")
    849 text = '\n'.join(forecast[12:]).strip()
    850 return {'issued_date': issued,

/sw/lib/python2.5/_strptime.py in strptime(data_string, format)
    328 if not found:
    329 raise ValueError("time data did not match format: data=%s fmt=%s" %
--> 330 (data_string, format))
    331 if len(data_string) != found.end():
    332 raise ValueError("unconverted data remains: %s" %

ValueError: time data did not match format: data=1009 PM CST WED FEB 25 2009 fmt=%I%M %p %Z %a %b %d %Y

I've messed with this issue a little bit before, but hadn't fixed it yet. I know it has something to do with the timezone names -- CDT versus CST. I think we just need to swap over to dateutil for anything TZ.

Related branches

Sean Stoops (brutimus)
Changed in python-earth:
importance: Undecided → High
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.