Skip to content

Unrecognised ISO 8601 date format #458

Open
@yajo

Description

@yajo

Check this out:

>>> from stdnum.eu.vat import check_vies                                                                                                                                                                      
>>> check_vies('DE123456788')
2024-11-11 12:26:59,636 119 ERROR prod zeep.xsd.types.simple: Error during xml -> python translation 
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/zeep/xsd/types/simple.py", line 79, in parse_xmlelement
    return self.pythonvalue(xmlelement.text)
  File "/usr/local/lib/python3.10/site-packages/zeep/xsd/types/builtins.py", line 44, in _wrapper
    return func(self, re.sub(r"[\n\r\t ]", " ", value).strip())
  File "/usr/local/lib/python3.10/site-packages/zeep/xsd/types/builtins.py", line 209, in pythonvalue
    return isodate.parse_date(value)
  File "/usr/local/lib/python3.10/site-packages/isodate/isodates.py", line 193, in parse_date
    raise ISO8601Error("Unrecognised ISO 8601 date format: %r" % datestring)
isodate.isoerror.ISO8601Error: Unrecognised ISO 8601 date format: '2024-11-11+01:00'
{
    'countryCode': 'DE',
    'vatNumber': '123456788',
    'requestDate': None,
    'valid': False,
    'name': None,
    'address': None
}

It seems like there's some error in the date format returned by the endpoint.

It also seems that it is just a warning, because the function returns a good value. However, it's logged with error level.

@moduon MT-7763

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions