-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot convert string value 1.1 at position 1 for the field RFCFLOAT to type RFCTYPE_FLOAT #142
Comments
I could not reproduce with clean django settings: import django # v 1.11.26
from django.conf import settings
settings.configure()
django.setup()
print(pyrfc.__version__) Could you please check if the issue happens with default django settings, like above? If default settings works, I would start from activating your django application settings step by step, to localise the root cause. |
I found what influences the way pyRFC works: locale Insteand of importing django there is a simple way to force the error: import locale
locale.setlocale(locale.LC_ALL, b'de_DE.UTF-8') I hope you can reproduce it now. I would suggest pyRFC avoids using the locale. I hate the locale. I wrote my anger down, in the hope other will avoid it from scratch: https://github.com/guettli/programming-guidelines/blob/master/README.md#avoid-posix-locale |
@bsrdjan Hi Sdrjan could you reproduce the error after setting the locale? |
Could you please check if the fix, works for your use-case? Float and Decimal are always accepted and strings only when decimal separator is correct, for the application locale. Grouping separators are not supported, application should handle. Unit tests: test_datatypes.py#L618 |
@bsrdjan yes, I installed pyrfc from git master and the float issue is gone now. Thank you very much! |
This snippet works:
But if I uncomment the two django-lines, then it fails with this exception:
Python 2.7
This is very strange, since importing django and calling
django.setup()
should not have any side-effects.I am running the latest version of PyRFC (master from github).
The text was updated successfully, but these errors were encountered: