One way I'm able to do further date parsing in other locales is to switch the locale for LC_TIME, bust the _strptime regular expressions manually, then call strptime() again. Here's a function to bust the cache. This works for me, but your mileage may vary. def bust_strptime_cache(): import _strptime _strptime._cache_lock.acquire() _strptime._TimeRE_cache = _strptime.TimeRE() _strptime._regex_cache = {} _strptime._cache_lock.release() This has been filed as Python bug #1290505. ( http://sf.net/support/tracker.php?aid=1290505 ) A full test case is attached to that bug. -- Adam Monsen http://adammonsen.com/
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4