Skip to content

Partitioned cookies on Python <3.14 #10380

Open
@Dreamsorcerer

Description

@Dreamsorcerer

In aiohttp 3.12 we'll have support for partitioned cookies, but this is dependent on upstream support in Python 3.14+.

If anyone needs support in an older release of Python, it can be monkey patched with this code:

if sys.version_info < (3, 14):
    from http import cookies

    # See: https://github.com/python/cpython/issues/112713
    cookies.Morsel._reserved["partitioned"] = "partitioned" 
    cookies.Morsel._flags.add("partitioned")

I'll leave this as a pinned issue for a couple of years until the feature is more widely available without monkey patching.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions