Skip to content
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

set_locale_radix ignored #371

Open
tidenhub opened this issue Jul 4, 2024 · 1 comment
Open

set_locale_radix ignored #371

tidenhub opened this issue Jul 4, 2024 · 1 comment

Comments

@tidenhub
Copy link

tidenhub commented Jul 4, 2024

I have set the locals to a language with a comma as a decimal separator, like "de_DE".

If I set set_locale_radix(".") I would expect that {"RFCFLOAT": "1.2"} could be parsed without errors.

But I'm getting the error pyrfc._exception.ExternalRuntimeError: 22 (rc=22): key=RFC_CONVERSION_FAILURE, message=Cannot convert string value 1.2 at position 1 for the field RFCFLOAT to type RFCTYPE_FLOAT [MSG: class=, type=, number=, v1-4:=;;;]

To Reproduce
Describe the steps to reproduce the behavior, including test script.

        setlocale(LC_ALL, "de_DE", )
        set_locale_radix(".")
        IMPORTSTRUCT = {"RFCFLOAT": "1.2"}
        output = client.call(
            "STFC_STRUCTURE",
            IMPORTSTRUCT=IMPORTSTRUCT,
        )["ECHOSTRUCT"]
        assert output["RFCFLOAT"] == 1.2

Aditional informaiton
If I replace set_locale_radix with locale.setlocale(locale.LC_NUMERIC, "en_GB.UTF-8") the script runs without any errors.

Environment

  • OpenSUSE Leap 15.6
  • Running in virtualenv
  • PyRFC==3.3.0
@hkroeber
Copy link

hkroeber commented Aug 6, 2024

Hi,
that issues has been already seen in an older pyrfc version and fixed. Please see #142.

And yes, I can confirm the issue for version 3.3.0 too.
Hagen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants