Skip to content

ARBSubscriptionType issue with Python 3.8 #145

Open
@countach74

Description

@countach74

When updating from Python 3.7 => 3.8, I've started to receive the following complaint from Authorize.net / PyXB:

TypeError: function takes 3 arguments plus optional tzinfo (8 given)
  File "authorizenet/apicontrollersbase.py", line 134, in execute
    xmlRequest = self.buildrequest()
  File "authorizenet/apicontrollersbase.py", line 105, in buildrequest
    xmlRequest = self._request.toxml(encoding=constants.xml_encoding, element_name=self.getrequesttype())
  File "pyxb/binding/basis.py", line 555, in toxml
    dom = self.toDOM(bds, element_name=element_name)
  File "pyxb/binding/basis.py", line 527, in toDOM
    self._toDOM_csc(bds, element)
  File "pyxb/binding/basis.py", line 2675, in _toDOM_csc
    content.elementDeclaration.toDOM(dom_support, parent, content.value)
  File "pyxb/binding/content.py", line 1101, in toDOM
    value._toDOM_csc(dom_support, element)
  File "pyxb/binding/basis.py", line 2675, in _toDOM_csc
    content.elementDeclaration.toDOM(dom_support, parent, content.value)
  File "pyxb/binding/content.py", line 1101, in toDOM
    value._toDOM_csc(dom_support, element)
  File "pyxb/binding/basis.py", line 2675, in _toDOM_csc
    content.elementDeclaration.toDOM(dom_support, parent, content.value)
  File "pyxb/binding/content.py", line 1101, in toDOM
    value._toDOM_csc(dom_support, element)
  File "pyxb/binding/basis.py", line 1119, in _toDOM_csc
    dom_support.appendTextChild(self, parent)
  File "pyxb/utils/domutils.py", line 584, in appendTextChild
    return parent.appendChild(self.document().createTextNode(self.valueAsText(text)))
  File "pyxb/utils/domutils.py", line 402, in valueAsText
    return value.xsdLiteral()
  File "pyxb/binding/basis.py", line 992, in xsdLiteral
    return self.XsdLiteral(self)
  File "pyxb/binding/datatypes.py", line 738, in XsdLiteral
    value += datetime.timedelta(minutes=cls.__MinutesPerHalfDay)
  File "pyxb/binding/datatypes.py", line 662, in __new__
    raise TypeError('function takes %d arguments plus optional tzinfo (%d given)' % (len(cls._ValidFields), len(args)))

It seems to be related to the paymentScheduleType.startDate property. I've tried setting it to a pyxb date, a python datetime.date, and a string. None of these work. And if I roll back to Python 3.7, the issue goes away. Any thoughts or suggestions? Is this a mistake on my end?

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