Skip to content

Cannot convert string value 1.1 at position 1 for the field RFCFLOAT to type RFCTYPE_FLOAT #142

Closed
@guettli

Description

@guettli

This snippet works:

# -*- coding: utf-8 -*
from __future__ import absolute_import, division, print_function, unicode_literals

from pyrfc import Connection

conn = Connection(...)

#import django
#django.setup()

result = conn.call(b'STFC_STRUCTURE', **{"IMPORTSTRUCT": {"RFCFLOAT": 1.1}})
print(result)

But if I uncomment the two django-lines, then it fails with this exception:

Traceback (most recent call last):
  File "tmp/float-error.py", line 11, in <module>
    result = conn.call(b'STFC_STRUCTURE', **{"IMPORTSTRUCT": {"RFCFLOAT": 1.1}})
  File "src/pyrfc/_pyrfc.pyx", line 415, in pyrfc._pyrfc.Connection.call
  File "src/pyrfc/_pyrfc.pyx", line 1650, in pyrfc._pyrfc.fillFunctionParameter
  File "src/pyrfc/_pyrfc.pyx", line 1700, in pyrfc._pyrfc.fillVariable
  File "src/pyrfc/_pyrfc.pyx", line 1662, in pyrfc._pyrfc.fillStructureField
  File "src/pyrfc/_pyrfc.pyx", line 1805, in pyrfc._pyrfc.fillVariable
pyrfc._exception.ExternalRuntimeError: RFC_CONVERSION_FAILURE (rc=22): key=RFC_CONVERSION_FAILURE, message=Cannot convert string value 1.1 at position 1 for the field RFCFLOAT to type RFCTYPE_FLOAT [MSG: class=, type=, number=, v1-4:=;;;]

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions