Jie Luo
cbacdf152a
Remove RegisterExtension in message class
...
PiperOrigin-RevId: 539568063
1 year ago
Jie Luo
60be96e0bf
-Make message __deepcopy__ call UPB code instead of default implementation for
...
python UPB (splitted change 2)
PiperOrigin-RevId: 528614850
2 years ago
Jie Luo
62f1470f09
-Make message CopyFrom() call UPB code instead of default implementation for python UPB
...
-Add upb_Message_Clear() in UPB accessors
-Add upb_Message_CopyFrom() in UPB copy
-Fix UPB upb_Message_DeepClone() bug for repeated extensions
PiperOrigin-RevId: 527644009
2 years ago
Eric Salo
565c8fe66e
upb: copy the wire decode recursion-depth-checking code to the wire encoder
...
PiperOrigin-RevId: 524873082
2 years ago
Eric Salo
b19c811493
Python: Allow de-serializing bytearray ( #868 )
...
Fix for https://github.com/protocolbuffers/protobuf/issues/10774
Closes #868
PiperOrigin-RevId: 524869277
2 years ago
Alexandre Jasmin
ebaecb7e09
Python: Allow de-serializing bytearray ( #868 )
...
Fix for https://github.com/protocolbuffers/protobuf/issues/10774
Closes #868
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/upb/pull/868 from ajasmin:bugfix/pythondeserialize-bytearray 5afeb11831fd6f2f80d032cfc54fb2e7bbe902ca
PiperOrigin-RevId: 524857599
2 years ago
Protobuf Team Bot
9d2b5d1716
Add upb_MiniTable_FindUnknown depth_limit parameter.
...
Fix UpbMessageIsEqual IsMap fallthrough.
PiperOrigin-RevId: 522961305
2 years ago
Eric Salo
ea4cb79f66
fix Python bug with required fields
...
https://github.com/protocolbuffers/upb/issues/1220
There were two bugs here: Python was incorrectly mandating that a required
field be set during assignment, and it was also incorrectly assuming a non-NULL
return from an internal function call.
PiperOrigin-RevId: 518561818
2 years ago
Eric Salo
b747edb830
append "ByDef" to names of message accessors that use reflection
...
PiperOrigin-RevId: 493018484
2 years ago
Eric Salo
0bb466356d
create text/ subdir for all text-format code
...
Currently all we have is an encoder but eventually a decoder will also go here.
PiperOrigin-RevId: 485911424
2 years ago
Eric Salo
41335a03be
normalize upb_Message_New()
...
We had _upb_Message_New(), which created a message from a mini table and was
being used outside of upb even though it is an internal-only function.
We also had upb_Message_New(), which created a message from a message def.
Now there is a single public function, upb_Message_New(), which creates a
message from a mini table and covers all use cases. (The internal version has the same definition and is used for inlining.)
PiperOrigin-RevId: 480169804
2 years ago
Eric Salo
edecfd5eb0
upb: use the new reflection headers
...
Reflection headers now live in upb/reflection/ so update our include statements to
reflect this. (See what I did there?)
PiperOrigin-RevId: 474596615
2 years ago
Eric Salo
27f8d367d3
fix segfault when clearing an unset oneof in Python
...
https://github.com/protocolbuffers/protobuf/issues/10461
PiperOrigin-RevId: 472891559
2 years ago
Eric Salo
c2c6427f60
upb: fix NULL pointer bug in Python FFI
...
Reference: https://github.com/protocolbuffers/protobuf/issues/10208
PiperOrigin-RevId: 460623221
2 years ago
Protobuf Team Bot
65bde4e75b
upb_Encode() now returns a status value
...
PiperOrigin-RevId: 454740100
2 years ago
Joshua Haberman
12fffeb9c3
Rename CMessage -> Message, to make the change in https://github.com/protocolbuffers/upb/pull/617 work as intended.
...
The previous change did not have the desired effect, because the generated code uses the class named "Message" instead of "CMessage."
There was no real need to use the class "CMessage" instead of "Message." The new name is simpler and will make the previous change work.
PiperOrigin-RevId: 449309343
3 years ago
Joshua Haberman
4e2bbc8a3a
Throw an exception with detailed information if generated code is out of date.
...
PiperOrigin-RevId: 449249979
3 years ago
Joshua Haberman
c3cfd09b01
Fix compiler warnings.
...
PiperOrigin-RevId: 447744251
3 years ago
Joshua Haberman
0abdee08b4
Fixed a test by extending Pythonic initialization to handle dicts in repeated fields.
...
PiperOrigin-RevId: 447128858
3 years ago
Joshua Haberman
ac27e3b317
Remaining fixes to make Python tests pass in google3.
3 years ago
Joshua Haberman
6a94a385f8
Factor out name differences into macros.
3 years ago
Joshua Haberman
0a858bb57a
Factor out name differences into macros.
3 years ago
Joshua Haberman
1c3d63dc25
Fixed a test by checking for the type of proto.
...
Also labeled a few tests for why we don't pass them.
3 years ago
Joshua Haberman
b38e4a4332
Fixed a few cases where we were not checking GetStrData properly.
3 years ago
Joshua Haberman
cd214fe73d
upb_TextEncode.
3 years ago
Joshua Haberman
0c541f3305
Single encode.
3 years ago
Joshua Haberman
72af9dc0cc
Switch to a single upb_Decode.
3 years ago
Joshua Haberman
499c2cc8b1
upb_extreg, upb_msg
3 years ago
Joshua Haberman
ffdcc46390
Fixed a handful of reference leaks found in a debug build of Python ( #484 )
...
* Fixed some reference leaks.
* Fixed a few reference leaks.
* Fixed a few more memory errors.
* Fixed a few more reference leaks.
* Revert minimal_test.py.
* Re-enable limited API.
* Removed some debugging and spurious changes.
* Addressed PR comments.
3 years ago
Joshua Haberman
1c955f37ce
Mass API rename and clang-reformat ( #485 )
...
* Wave 1: upb_fielddef.
* upb_fielddef itself.
* upb_oneofdef.
* upb_msgdef.
* ExtensionRange.
* upb_enumdef
* upb_enumvaldef
* upb_filedef
* upb_methoddef
* upb_servicedef
* upb_symtab
* upb_defpool_init
* upb_wellknown and upb_syntax_t
* Some constants.
* upb_status
* upb_strview
* upb_arena
* upb.h constants
* reflection
* encode
* JSON decode.
* json encode.
* msg_internal.
* Formatted with clang-format.
* Some naming fixups and comment reformatting.
* More refinements.
* A few more stragglers.
* Fixed PyObject_HEAD with semicolon. Removed TODO entries.
3 years ago
Joshua Haberman
201d2265e3
Variable rename for readability.
3 years ago
Joshua Haberman
8c256cc677
Addressed PR comments.
3 years ago
Joshua Haberman
fff8dfb035
Cleaned up reporting of initialization errors.
3 years ago
Joshua Haberman
4c005384d6
A few readability improvements.
3 years ago
Joshua Haberman
d4c0c638b8
Cleaned up ListFields sorting.
3 years ago
Joshua Haberman
d8915b3174
Cleaned up IsInitialized().
3 years ago
Joshua Haberman
3eae44bada
Refine the exception type when assigning improper attributes.
3 years ago
Joshua Haberman
1c37c488d4
Refined error message.
3 years ago
Joshua Haberman
8af637bcd2
Added extension field numbers.
3 years ago
Joshua Haberman
c75b39fc4d
Accept bytes object as field name.
3 years ago
Joshua Haberman
61d6eff5c4
Throw the proper errors for message initialization failure.
3 years ago
Joshua Haberman
4984a22e75
Fixed error message when serializing with required fields missing.
3 years ago
Joshua Haberman
3b25e6fde3
Implemented msg.<NAME>_FIELD_NUMBER attributes.
3 years ago
Joshua Haberman
4993f7a73a
Sort ListFields() results.
3 years ago
Joshua Haberman
cbe314d91e
Implemented IsInitialized(), fixing several more tests.
3 years ago
Joshua Haberman
4447d87695
Fixed tests that were missing enum type wrapper class.
3 years ago
Joshua Haberman
1be47593f0
Fixed disconnecting before Clear().
3 years ago
Joshua Haberman
e5d8d28b0f
Addressed PR comments.
3 years ago
Joshua Haberman
54b775d4f4
WIP.
3 years ago
Joshua Haberman
7260346e30
Fixed validation of extension field descriptors.
3 years ago