Fast-F1 icon indicating copy to clipboard operation
Fast-F1 copied to clipboard

[BUG] empty string sent to utils.to_datetime

Open Casper-Guo opened this issue 1 year ago • 0 comments

Describe the issue:

Calling get_event_schedule causes the empty string to be sent to utils.datetime. The exception is handled but it shows up in the log.

Reproduce the code example:

import logging
import fastf1 as f

logging.basicConfig(
    level=logging.INFO, format="%(levelname)s\t%(filename)s\t%(message)s"
)

f.get_event_schedule(2024)

Error message:

DEBUG   utils.py        Failed to parse datetime string ''
Traceback (most recent call last):
  File "/home/robery/.local/lib/python3.11/site-packages/fastf1/utils.py", line 208, in to_datetime
    date, time = x.strip('Z').split('T')
    ^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)
DEBUG   utils.py        Failed to parse datetime string ''
Traceback (most recent call last):
  File "/home/robery/.local/lib/python3.11/site-packages/fastf1/utils.py", line 208, in to_datetime
    date, time = x.strip('Z').split('T')
    ^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)

Casper-Guo avatar Feb 22 '24 18:02 Casper-Guo