Skip to content

[BUG] ValueError: time data does not match format #125

Open

Description

@asfak-ur-rahman

Hello, I have been using the DeepL (v1.18.0) to translate documents since 26/Dec/2023. But suddenly it stopped working yesterday (10/Dec/2024) after 4 am PST and our last 30 translation requests were not complete.

I have not made any changes recently. As per my investigation, I have noticed the following error in translator.get_glossary().

File "/home/guardiansofthein/py_api/helper.py", line 2222, in deepl_api_translate_doc
    my_glossary = translator.get_glossary(glossary_id)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/guardiansofthein/py_api/ve_py312/lib/python3.12/site-packages/deepl/translator.py", line 979, in get_glossary
    return GlossaryInfo.from_json(json)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/guardiansofthein/py_api/ve_py312/lib/python3.12/site-packages/deepl/api_data.py", line 154, in from_json
    datetime.datetime.strptime(
File "/usr/local/lib/python3.12/_strptime.py", line 554, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/_strptime.py", line 333, in _strptime
    raise ValueError("time data %r does not match format %r" %

ValueError: time data '0001-01-01T00:0000' does not match format '%Y-%m-%dT%H:%M:%S.%f%z'

I am just passing glossary_id in the get_glossary() function, but I have no control over the time data. So how can I fix this error now?

Activity

  1. changed the title [-]ValueError: time data does not match format[/-] [+][BUG] ValueError: time data does not match format[/+] on Dec 11, 2024
  2. JanEbbing commented on Dec 11, 2024

    @JanEbbing
    Contributor

    This is due to DeepL/deepl-api-issues#37

    We are on it, thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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