diff --git a/src/itsdangerous/timed.py b/src/itsdangerous/timed.py index 9187a44..548054c 100644 --- a/src/itsdangerous/timed.py +++ b/src/itsdangerous/timed.py @@ -127,7 +127,8 @@ def unsign( if ts_int is not None: try: ts_dt = self.timestamp_to_datetime(ts_int) - except ValueError as exc: + except (ValueError, OSError) as exc: + # Windows raises OSError raise BadTimeSignature( "Malformed timestamp", payload=value ) from exc diff --git a/tests/test_itsdangerous/test_timed.py b/tests/test_itsdangerous/test_timed.py index f677b72..56041f0 100644 --- a/tests/test_itsdangerous/test_timed.py +++ b/tests/test_itsdangerous/test_timed.py @@ -67,9 +67,6 @@ def test_malformed_timestamp(self, signer): assert "Malformed" in str(exc_info.value) assert exc_info.value.date_signed is None - @pytest.mark.skipif( - sys.platform == "win32", reason="Freezegun Invalid argument occurs on Windows" - ) def test_malformed_future_timestamp(self, signer): signed = b"value.TgPVoaGhoQ.AGBfQ6G6cr07byTRt0zAdPljHOY"