Skip to content

Commit

Permalink
catch OSError on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism committed Mar 9, 2022
1 parent 37f0997 commit 017a684
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/itsdangerous/timed.py
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions tests/test_itsdangerous/test_timed.py
Expand Up @@ -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"

Expand Down

0 comments on commit 017a684

Please sign in to comment.