On Tue, 4 Nov 2008, Aaron Lav wrote:

> I noticed that sometimes the Python exception isn't correctly set
> when a Java method throws a java RuntimeException, which causes a Python
> SystemError.
>
> I've attached a test case which specifies JavaError, since that's what
> the old PyLucene did:
>
>>>> DateField.dateToString(SimpleDateFormat('yyyy-MM-dd').parse('1900-1-1'))
> Traceback (most recent call last):
>  File "<stdin>", line 1, in ?
> PyLucene.JavaError: java.lang.RuntimeException: time '-2208967200000' is too 
> early, must be >= 0
>
> (I had to call SimpleDateFormat().parse(), since I got an InvalidArgsError
> with just "DateField.dateToString(Date(0,1,1))")

Hmm, I'm confused. For me:

     >>> DateField.dateToString(Date(0,1,1))
     Traceback (most recent call last):
       File "<stdin>", line 1, in <module>
     lucene.JavaError: java.lang.RuntimeException: time '-2206281600000' is
     too early, must be >= 0

     >>> 
DateField.dateToString(SimpleDateFormat('yyyy-MM-dd').parse('1900-1-1'))
     Traceback (most recent call last):
       File "<stdin>", line 1, in <module>
     lucene.JavaError: java.lang.RuntimeException: time '-2206281600000' is
     too early, must be >= 0

They seem to work the same. No InvalidArgsError. What InvalidArgsError are 
you getting ?
Your test passes here without any changes.

Am I misunderstanding something ?

Andi..
_______________________________________________
pylucene-dev mailing list
pylucene-dev@osafoundation.org
http://lists.osafoundation.org/mailman/listinfo/pylucene-dev

Reply via email to