Ticket #691 (new bug)

Opened 4 years ago

BasketFeeder incorrectly respects locale

Reported by: matija Owned by: janez
Milestone: Future Component: library
Severity: major Keywords:
Cc: Blocking:
Blocked By:


In Orange Canvas, reading a '.basket' file with specified decimal quantities (eg. "reading=3.000") on a machine with decimal separator set to something else than a period fails. TBasketFeeder::addItem (basket.cpp) uses strtod, which respects locale. Saving an Orange.data.Table to '.basket' file stores quantities with 3 decimal places using the dot separator, so Orange cannot even read files it produced.

For example: import Orange Orange.data.Table('inquisition.basket').save('/tmp/test.basket')

Now, the newly produced basket file cannot be read in Orange Canvas on a Linux machine with sl_SI.utf8 (Slovene UTF8) locale; File widget fails with "'orange.BasketFeeder': invalid number after 'surprise=' in line 2".

In vars.cpp, TFloatVariable::str2val_low handles decimal separators correctly.

Note: See TracTickets for help on using tickets.