From 982a3a5a381a47e67e5463deb7a19b0f5e76c850 Mon Sep 17 00:00:00 2001 From: Fedoroff Date: Tue, 27 Oct 2026 20:51:32 +0300 Subject: [PATCH] fix: support Python 3.10 on Windows --- Makefile | 2 +- tests/client.py | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 5d86d17..d739fcd 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PYTHON ?= python3 +PYTHON ?= py -3 BASE_URL ?= http://localhost:8080 CA_FILE ?= ACTION_SCRIPT ?= diff --git a/tests/client.py b/tests/client.py index da141ba..4c6565c 100644 --- a/tests/client.py +++ b/tests/client.py @@ -29,8 +29,21 @@ def timestamp(value): 'timestamp must be UTC ending in Z' ) try: - return dt.datetime.fromisoformat(value[:-1] + '+00:00') - except ValueError as exc: + normalized = value[:-1] + '+00:00' + + if '.' in normalized: + prefix, fraction = normalized.split('.', 1) + digits, timezone = fraction.split('+', 1) + + if not digits.isdigit() or len(digits) > 9: + raise ValueError('invalid fractional seconds') + + digits = digits[:6].ljust(6, '0') + normalized = f'{prefix}.{digits}+{timezone}' + + return dt.datetime.fromisoformat(normalized) + + except (ValueError, TypeError) as exc: raise Failure(f'invalid RFC3339 timestamp: {value!r}') from exc def validate(value, schema, where='response'):