You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For me, it would be best if this check was removed completely.
It think using stack inspection is, in general, a risky proposition and very unpythonic (and thus, not well supported in python).
I understand that these methods are not part of the external API of the library, and it is good to warn programmers of their mistakes, but it also violates the programming principle that a method should not respond differently based on who calls it.
Wouter
The text was updated successfully, but these errors were encountered:
elharo
changed the title
Python protobug refuses to work when converting modules into packages
Python protobuf refuses to work when converting modules into packages
Feb 23, 2022
From 3.20.0, we have simplified the python generated code which the check should not invoked. Both protoc and python runtime need to be 3.20.0 or above
What version of protobuf and what language are you using?
Version: 3.19.4 (latest)
Language: Python
What operating system (Linux, Windows, ...) and version?
Linux
What runtime / compiler are you using (e.g., python version or gcc version)
Python 3.6
What did you do?
Steps to reproduce the behavior:
{something}_pb2.py
to{something}_pb2/__init__.py
(which is, as far as python is concerned, the exact same thing)What did you expect to see
That this works
What did you see instead?
An exception stating
Anything else we should know about your project / environment
This fails because of this check
https://github.com/protocolbuffers/protobuf/blob/HEAD/python/google/protobuf/pyext/descriptor.cc#L130
That doesn't include the ability of every module in python to be in a file
__init__.py
.For me, it would be best if this check was removed completely.
It think using stack inspection is, in general, a risky proposition and very unpythonic (and thus, not well supported in python).
I understand that these methods are not part of the external API of the library, and it is good to warn programmers of their mistakes, but it also violates the programming principle that a method should not respond differently based on who calls it.
Wouter
The text was updated successfully, but these errors were encountered: