Skip to content

[3.9] Import fails on Windows PyPy #7848

@JelleZijlstra

Description

@JelleZijlstra

Describe the bug

Importing aiohttp 3.9.0 on Windows in PyPy 3.8 fails with an error about time.gmtime.

To Reproduce

  • Run PyPy 3.8 on Windows
  • import aiohttp

Expected behavior

No crash

Logs/tracebacks

.tox\ci-pypy3\lib\site-packages\aiohttp\__init__.py:6: in <module>
    from .client import (
.tox\ci-pypy3\lib\site-packages\aiohttp\client.py:76: in <module>
    from .cookiejar import CookieJar
.tox\ci-pypy3\lib\site-packages\aiohttp\cookiejar.py:39: in <module>
    class CookieJar(AbstractCookieJar):
.tox\ci-pypy3\lib\site-packages\aiohttp\cookiejar.py:64: in CookieJar
    calendar.timegm(time.gmtime(MAX_TIME))
E   ValueError: Invalid argument

(Seen in Black's CI)



### Python Version

```console
Successfully set up PyPy 7.3.11 with Python (3.8.16)

aiohttp Version

Successfully installed aiohttp-3.9.0 aiosignal-1.3.1 async-timeout-4.0.3 attrs-23.1.0 black-0.1.dev1+g7e1ebdd click-8.1.7 frozenlist-1.4.0 idna-3.4 multidict-6.0.4 mypy-extensions-1.0.0 pathspec-0.11.2 typing-extensions-4.8.0 yarl-1.9.2

multidict Version

multidict-6.0.4

yarl Version

yarl-1.9.2

OS

Windows

Related component

Server

Additional context

This seems related to #7824. It already catches OSError; I suspect PyPy just throws a different exception here.

Code of Conduct

  • I agree to follow the aio-libs Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions