From 551c0b049137f9489654a7c0d83189a6c1a94a84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20M=C3=BCller?= Date: Thu, 24 Mar 2022 13:02:13 +0100 Subject: [PATCH] Handle OverflowError on parsing timestamps as BadTimeSignature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit on 32bit platforms the test TestTimestampSigner::test_malformed_future_timestamp causes an OverflowError. Catch this and raise it as BadTimeSignature Signed-off-by: Dirk Müller --- src/itsdangerous/timed.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/itsdangerous/timed.py b/src/itsdangerous/timed.py index fd9257a..96820ab 100644 --- a/src/itsdangerous/timed.py +++ b/src/itsdangerous/timed.py @@ -126,7 +126,7 @@ def unsign( if ts_int is not None: try: ts_dt = self.timestamp_to_datetime(ts_int) - except (ValueError, OSError) as exc: + except (OverflowError, ValueError, OSError) as exc: # Windows raises OSError raise BadTimeSignature( "Malformed timestamp", payload=value