luoj-roger / solrpy

Automatically exported from code.google.com/p/solrpy
0 stars 0 forks source link

utc_from_string throws a ValueError for really old dates returned from Solr #30

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Index a date before 1000-01-01
2. do a search that returns that record

What is the expected output? What do you see instead?

I expect search results, though the code throws a ValueError exception.

In this case, the date string returned from Solr is: "209-01-01T08:00:00Z"

What version of the product are you using? On what operating system?

solrpy==0.9.5 on Debian Linux with Solr 3.4.0

Please provide any additional information below.

It looks like utc_from_string expects Solr to return a 4 digit year, though 
this apparently isn't always the case. Let me know if I can provide any more 
useful info.

Original issue reported on code.google.com by smcdon...@bepress.com on 4 Oct 2012 at 11:24

GoogleCodeExporter commented 9 years ago
This is actually a bug (as far as ISO8601 representation goes) that has been 
fixed in Solr (https://issues.apache.org/jira/browse/SOLR-2772). Of course, it 
can be fixed in Python in any case...

Original comment by joel.nothman@gmail.com on 28 Oct 2012 at 5:36