-
Notifications
You must be signed in to change notification settings - Fork 15.8k
Description
What version of protobuf and what language are you using?
Version: 3.19.6
The line that sets the docstring is present in the current release (22.1) and main
, so I suspect that they will also be affected:
setattr(cls, property_name, _FieldProperty(field, getter, setter, doc=doc)) |
Language: Python
What operating system (Linux, Windows, ...) and version?
Fedora Linux Rawhide/39, plus experimental Python 3.12: https://copr.fedorainfracloud.org/coprs/g/python/python3.12/
What runtime / compiler are you using (e.g., python version or gcc version)
Python 3.12.0a5, GCC 13.0.1
What did you do?
Steps to reproduce the behavior:
- Build the pure-Python version of the Python protobuf extension.
from google.protobuf import descriptor_pb2
This import occurred in the generated proto bindings in googleapis-common-protos
; see downstream bug https://bugzilla.redhat.com/show_bug.cgi?id=2176158.
What did you expect to see
Successful import with no output.
What did you see instead?
[…]
File "/usr/lib/python3.12/site-packages/google/protobuf/descriptor_pool.py", line 216, in AddSerializedFile
from google.protobuf import descriptor_pb2
File "/usr/lib/python3.12/site-packages/google/protobuf/descriptor_pb2.py", line 1883, in <module>
FileDescriptorSet = _reflection.GeneratedProtocolMessageType('FileDescriptorSet', (_message.Message,), {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/google/protobuf/internal/python_message.py", line 198, in __init__
_AddPropertiesForFields(descriptor, cls)
File "/usr/lib/python3.12/site-packages/google/protobuf/internal/python_message.py", line 586, in _AddPropertiesForFields
_AddPropertiesForField(field, cls)
File "/usr/lib/python3.12/site-packages/google/protobuf/internal/python_message.py", line 612, in _AddPropertiesForField
_AddPropertiesForRepeatedField(field, cls)
File "/usr/lib/python3.12/site-packages/google/protobuf/internal/python_message.py", line 668, in _AddPropertiesForRepeatedField
setattr(cls, property_name, _FieldProperty(field, getter, setter, doc=doc))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/google/protobuf/internal/python_message.py", line 623, in __init__
property.__init__(self, getter, setter, doc=doc)
AttributeError: '_FieldProperty' object attribute '__doc__' is read-only
Anything else we should know about your project / environment
See also: #12186