Skip to content

Commit 96ef1fb

Browse files
authored
Updated the maxtime for running in windows
In windows , if the year parameter of the datetime.datetime class is greater than 3001 , it returns OSError: [Errno 22] Invalid argument for Windows 10 operating system. It works fine in Linux. It could be a bug in the python. Setting the year value for max_time to 3001 will fix this error for windows.
1 parent 6c0c157 commit 96ef1fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

streaming_data_types/area_detector_ADAr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ def deserialise_ADAr(buffer: Union[bytearray, bytes]) -> ADArray:
166166
ad_array = ADArray.ADArray.GetRootAsADArray(buffer, 0)
167167
unique_id = ad_array.Id()
168168
max_time = datetime(
169-
year=9000, month=1, day=1, hour=0, minute=0, second=0
169+
year=3001, month=1, day=1, hour=0, minute=0, second=0
170170
).timestamp()
171171
used_timestamp = ad_array.Timestamp() / 1e9
172172
if used_timestamp > max_time:

0 commit comments

Comments
 (0)