fix(python): preserve marshal scalar identity and decode limits

This commit is contained in:
morluto
2026-10-24 02:29:36 +08:00
parent a47788a6a4
commit 06032237c6
7 changed files with 164 additions and 25 deletions
+5 -1
View File
@@ -1,3 +1,5 @@
import type { PYTHON_PYC_LIMIT_MAXIMA } from "../domain/python/pythonPyc.js";
/** Distinguish corrupt recognized pycs from magics outside parser coverage. */
export class PythonPycFormatFailure extends Error {
constructor(
@@ -13,7 +15,9 @@ export class PythonPycFormatFailure extends Error {
export class PythonPycResourceFailure extends Error {
constructor(
readonly boundary: "objects" | "depth" | "string",
readonly reported_limits: Readonly<Record<string, number>>,
readonly reported_limits: Readonly<
Partial<Record<keyof typeof PYTHON_PYC_LIMIT_MAXIMA, number>>
>,
message: string,
) {
super(message);