Commit 41e1bc8
committed
Python: Serialize large integers as strings in RPC to avoid Jackson limits
Jackson 2.15+ rejects JSON numbers exceeding 1000 digits via
StreamReadConstraints.getMaxNumberLength(). Python integers have
no size limit, so a literal like paramiko's 4096-bit DH prime
(1234 decimal digits) was serialized as a raw JSON number, causing
deserialization to fail on the Java side.
Convert integers exceeding Java's long range to strings before
serialization. The original source representation is preserved in
the literal's valueSource field, so printing is unaffected.1 parent 78d3500 commit 41e1bc8
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
320 | 327 | | |
321 | 328 | | |
322 | 329 | | |
| |||
0 commit comments