Python Version
3.12
pytest Version
No response
Package Version
2.14.0
Description
The following Python script:
from datetime import timedelta
import time_machine
with time_machine.travel(timedelta()):
pass
crashes due to a segmentation fault in the constructor of the travel class.
The crash happens when the constructor tries to determine the destination timestamp like this:
timestamp = time() + dest.total_seconds()
where time() calls result = _time_machine.original_time() which crashes if time_machine's patches are not applied yet and thus the original_time function pointer is still NULL.
Python Version
3.12
pytest Version
No response
Package Version
2.14.0
Description
The following Python script:
crashes due to a segmentation fault in the constructor of the
travelclass.The crash happens when the constructor tries to determine the destination timestamp like this:
where
time()callsresult = _time_machine.original_time()which crashes if time_machine's patches are not applied yet and thus theoriginal_timefunction pointer is stillNULL.