Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
yuanjie-ai opened this issue Jul 4, 2023 · 1 comment

Comments

@yuanjie-ai
Copy link

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?
@allrobot
Copy link

allrobot commented Jun 7, 2024

In the sample, there is some code that cannot be compiled normally. Did the author not test each piece individually when writing the documentation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants