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

Python DeprecationWarning: uses PyType_Spec with a metaclass that has custom tp_new #15077

Closed
sodul opened this issue Dec 13, 2023 · 2 comments · Fixed by #15999
Closed

Python DeprecationWarning: uses PyType_Spec with a metaclass that has custom tp_new #15077

sodul opened this issue Dec 13, 2023 · 2 comments · Fixed by #15999
Assignees

Comments

@sodul
Copy link

sodul commented Dec 13, 2023

What version of protobuf and what language are you using?
Version: Python protobuf 4.25.1 (latest)
Language: Python

What operating system (Linux, Windows, ...) and version?
macOS 14.1.2, Ubuntu 20.04 LTS.

What runtime / compiler are you using (e.g., python version or gcc version)
Python 3.12.1

What did you do?
Run internal code that uses protobufs.

What did you expect to see
No deprecation warnings.

What did you see instead?

<frozen importlib._bootstrap>:488
  <frozen importlib._bootstrap>:488: DeprecationWarning: Type google._upb._message.MessageMapContainer uses PyType_Spec with a metaclass that has custom tp_new. This is deprecated and will no longer be allowed in Python 3.14.
@sodul sodul added the untriaged auto added to all issues by default when created. label Dec 13, 2023
@FrancescElies
Copy link

I also see this with v4.25.2, I think this might be related to #12186

@googleberg
Copy link
Member

@zhangskz Can you take a look at this?

@googleberg googleberg removed the untriaged auto added to all issues by default when created. label Feb 17, 2024
copybara-service bot pushed a commit that referenced this issue Mar 6, 2024
…ableMapping instead of inheriting directly.

This prevents these from using abc.ABCMeta metaclass to avoid deprecation warning:
```
DeprecationWarning: Type google._upb._message.MessageMapContainer uses PyType_Spec with a metaclass that has custom tp_new. This is deprecated and will no longer be allowed in Python 3.14.
```

Fixes #15077
Fixes #12186

PiperOrigin-RevId: 609782761
deannagarcia pushed a commit to deannagarcia/protobuf that referenced this issue Jun 20, 2024
…ableMapping instead of inheriting directly.

This prevents these from using abc.ABCMeta metaclass to avoid deprecation warning:
```
DeprecationWarning: Type google._upb._message.MessageMapContainer uses PyType_Spec with a metaclass that has custom tp_new. This is deprecated and will no longer be allowed in Python 3.14.
```

Fixes protocolbuffers#15077
Fixes protocolbuffers#12186

PiperOrigin-RevId: 613029479
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants