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

[ValueERR] mutable default <class 'wechaty_puppet.schemas.puppet.PuppetOptions'> for field puppet_options is not allowed: use default_factory #422

Open
minkuang1982 opened this issue Feb 16, 2024 · 1 comment

Comments

@minkuang1982
Copy link

"""doc"""
import asyncio
import logging
from typing import Optional, Union
from wechaty_puppet import FileBox

from urllib.parse import urlparse
def get_host(url: str) -> (str, str, str):
parsed_url = urlparse(url)
return parsed_url.scheme, parsed_url.netloc, parsed_url.path

import urllib3
urllib3.get_host = get_host

from wechaty import Wechaty, Contact

Then Error happened:
Exception has occurred: ValueError
mutable default <class 'wechaty_puppet.schemas.puppet.PuppetOptions'> for field puppet_options is not allowed: use default_factory
File "D:\AI\DingDongBotPy\DingDongBot.py", line 15, in
from wechaty import Wechaty, Contact
ValueError: mutable default <class 'wechaty_puppet.schemas.puppet.PuppetOptions'> for field puppet_options is not allowed: use default_factory

how to solve it ?

@doublewinter0
Copy link
Contributor

You may try Python 3.10

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