Skip to content

Commit

Permalink
Handle OverflowError on parsing timestamps as BadTimeSignature
Browse files Browse the repository at this point in the history
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 <dirk@dmllr.de>
  • Loading branch information
dirkmueller committed Mar 24, 2022
1 parent fbdc27c commit 551c0b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/itsdangerous/timed.py
Expand Up @@ -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
Expand Down

0 comments on commit 551c0b0

Please sign in to comment.