Skip to content

_pickle.PicklingError: Can't pickle <function get at 0x12cb5ea60>: attribute lookup get on __main__ failed #186

Description

@yuanjie-ai

Description

import asyncio
from aiohttp import request
from aiomultiprocess import Pool  # todo


async def get(url):
    async with request("GET", url) as response:
        return await response.text("utf-8")


async def mainmain():
    urls = ["https://www.baidu.com"]*10
    async with Pool() as pool:
        results = await pool.map(get, urls)

        return results


if __name__ == '__main__':
    # Python 3.7
    asyncio.run(mainmain())

Details

  • OS: macos
  • Python version: 3.8
  • aiomultiprocess version: 0.9
  • Can you repro on master?
  • Can you repro in a clean virtualenv?

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