Float parsing is culture dependent (patch included)

Hi,

if you type “1.0” then enter under rbx on a french machine (or any
machine with something different than dot for the decimal separator),
you’ll get an exception.

I’ve attached a patch which works for me.

– Thibaut

FYI we’ve also recently ran into some IronPython bugs which were
“culture” dependent as well. In our case these were date/time methods.
If anyone’s interested in taking it on it might be interesting to see
all the results from running the various tests under alternate
“cultures”.


From: [email protected]
[[email protected]] On Behalf Of Thibaut Barrère
[[email protected]]
Sent: Saturday, January 12, 2008 1:33 AM
To: [email protected]
Subject: [Ironruby-core] Float parsing is culture dependent (patch
included)

Hi,

if you type “1.0” then enter under rbx on a french machine (or any
machine with something different than dot for the decimal separator),
you’ll get an exception.

I’ve attached a patch which works for me.

– Thibaut

I ran rake specs. Before my patch, it blew up at
core/struct/each_pair_spec.rb (the very beginning).
After applying the patch, I get this amount of failures:

Total failures: 347 out of 1029 examples

Not sure how this compares to an english machine ?

Running “rake test” also blew up just after Dir tests. Applying the
patch managed to let the runner reach third test of StringScanner#new
(which blows up and makes rake abort).

If someone would like to get the full “rake specs” output, drop me a
line (it’s 370kb long - I thought I wouldn’t send it to the list
directly).

cheers

– Thibaut

Thibaut Barrère:

if you type “1.0” then enter under rbx on a french machine (or any
machine with something different than dot for the decimal separator),
you’ll get an exception.

I’ve attached a patch which works for me.

Thanks for sending in this patch! I’ll make sure this makes it into our
next push.

-John

Isn’t this patch hitting Tokenizer.cs inside the IronRuby.dll?

Thanks for sending in this patch! I’ll make sure this makes it into our next push.

Great - is it sure to be included by the end of this month ? (I’m
pretty sure so).

If it is, I won’t have to include the patch in my article.

cheers

– Thibaut

Thibaut Barrère:

Running “rake test” also blew up just after Dir tests. Applying the
patch managed to let the runner reach third test of StringScanner#new
(which blows up and makes rake abort).

This is a known bug. I’ve got a shelveset with a fix for it that I’m
going to commit with the next set of changes early next week.

Thanks,
-John

This is fixed already as part of some other work that Tomas is doing on the tokenizer, so yes - definitely by the end of this month.

Perfect - thanks!

– Thibaut

Thibaut Barrère:

Great - is it sure to be included by the end of this month ? (I’m
pretty sure so).

If it is, I won’t have to include the patch in my article.

This is fixed already as part of some other work that Tomas is doing on
the tokenizer, so yes - definitely by the end of this month.

-John

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs