Skip to content

V1Pod no longer pickleable with some logging configs #1304

@jedcunningham

Description

@jedcunningham

What happened (please include outputs or screenshots):

Starting with 12.0.0, V1Pod now is no longer pickleable depending on how logging is configured.

What you expected to happen:

V1Pod is pickleable.

How to reproduce it (as minimally and precisely as possible):

>>> from kubernetes.client import models as k8s
>>> import logging
>>> import pickle
>>> logging.basicConfig()
>>> p = k8s.V1Pod()
>>> pickle.dumps(p)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can't pickle _thread.RLock objects

Anything else we need to know?:

I believe it is unrelated, but this was initially found in apache/airflow, as it pickles V1Pods.

Environment:

  • Python version: 3.6.12
  • Python client version: 12.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions