These are chat archives for spyder-ide/public
when locale settings were set to German instead of English (there a comma would actually be correct).
Indeed, you are probably on to something here, since @ccordoba12 mentioned environment variables (which could also include user locale settings C or Python is reading on startup or in operation) which is affecting the float -> string (and thus string -> float) conversion somewhere within there—in particular, perhaps something within that function or the stuff it calls is locale-sensitive (and isn't supposed to be); the reason you can't directly step into it is because its C code (as near as I can tell, its this function. You could try comparing your environment variables, locale settings etc. between the inside and outside Spyder environments, and try directly calling that function if you can figure out what to feed it and see what it outputs in both cases.
As a 'Murican I'm not that familiar with i18n issues like that , but maybe Carlos would know more.
I got one step further:
According to SO you can check the locale settings like this:
import locale locale.localeconv()["decimal_point"]
which gives "," in spyder but "." in all the other consoles.
Though I'm using spyder in the english version and I did try with both - german and english keyboard settings (I did change the ubuntu keyboard settings before I started the shell in which I started sypder...) it always produced the error...
locale.setlocale(locale.LC_ALL, locale="en-US.UTF-8")to set it and see if it fixes it?
locale.setlocale(locale.LC_ALL, locale="en_US.UTF-8"), and it worked....
locale.LC_NUMERICmust have been different than the overall locale, or something was messed up then...
locale.LC_NUMERIC was always equals to 1 (before and after changing the settings)
Anyway, I guess It would probably make sense to report the issue to the tensorflow guys, so that they know that their current code only works with english localizations.
However, I still wonder why my localization differs in Spyder compared to the rest of the system... Any idea on that...?