Skip to content

Deepcopying telegram.Bot should raise a clear exception #3445

@Bibo-Joshi

Description

@Bibo-Joshi

We already have Bot.__reduce__ in place which produces an exception if one tries to pickle a Bot, but deepcopying bots does not raise an immediate exception as apparently the superclasses custom TelegramObject.__deepcopy__ has more priority than __reduce__.
Instead deepcopy will with a mysterious error message about being anable to pickle locks, which are buried somewhere in the httpx clients …

It's probably best to just override __deepcopy__ in analogy to __reduce__

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions