{"record":{"id":"6012820be32aecbe","repo":"python/cpython","slug":"need-to-specify-the-name-input-and-output-paths","errorCode":null,"errorMessage":"need to specify the name, input and output paths\n","messagePattern":"need to specify the name, input and output paths\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"Programs/_freeze_module.c","lineNumber":230,"sourceCode":"        return -1;\n    }\n    fclose(outfile);\n    return 0;\n}\n\nint\nmain(int argc, char *argv[])\n{\n    const char *name, *inpath, *outpath;\n\n    _PyImport_FrozenBootstrap = no_modules;\n    _PyImport_FrozenStdlib = no_modules;\n    _PyImport_FrozenTest = no_modules;\n    PyImport_FrozenModules = NULL;\n    _PyImport_FrozenAliases = aliases;\n\n    if (argc != 4) {\n        fprintf(stderr, \"need to specify the name, input and output paths\\n\");\n        return 2;\n    }\n    name = argv[1];\n    inpath = argv[2];\n    outpath = argv[3];\n\n    runtime_init();\n\n    const char *text = read_text(inpath);\n    if (text == NULL) {\n        goto error;\n    }\n\n    PyObject *marshalled = compile_and_marshal(name, text);\n    free((char *)text);\n    if (marshalled == NULL) {\n        goto error;\n    }","sourceCodeStart":212,"sourceCodeEnd":248,"githubUrl":"https://github.com/python/cpython/blob/bc6749cc3b5ae4a5e88a6cc2d5b3bebbe354eae6/Programs/_freeze_module.c#L212-L248","documentation":"Usage error from Programs/_freeze_module.c's main(): the program takes exactly three positional arguments (frozen module name, input source path, output C path) and argc != 4 (program + 3 args) means it was invoked with the wrong number of arguments; it prints this usage line and exits with status 2.","triggerScenarios":"Running `_freeze_module name in.py` (missing out path), with extra args, or with none; build scripts/regen targets constructed with a missing variable so the command line degenerates.","commonSituations":"Manually reproducing a freeze step from a Makefile line and dropping an argument; build system variable (e.g. $OUT) empty so the word count is short; wrapper scripts mangling quoting so args merge or split.","solutions":["Invoke with exactly three args: `_freeze_module <name> <inpath> <outpath>`","Inspect the failing command line in the build log and fix the empty/missing variable","Copy the exact command from the Makefile rule rather than retyping it"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# shell: enforce the exact freezer signature before running\n# freeze() { [ $# -eq 3 ] || { echo 'usage: freeze NAME IN OUT' >&2; return 2; }; ./_freeze_module \"$@\"; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Wrap the freezer in a shell function that checks arg count == 3","set -u in build scripts so empty variables fail early instead of shifting argc","Copy commands verbatim from the Makefile when reproducing build steps"],"tags":["cpython","build","freeze-module","usage","cli-args"],"backgroundTag":null,"analyzedSha":"bc6749cc3b5ae4a5e88a6cc2d5b3bebbe354eae6","analyzedAt":"2026-08-14T22:01:13.976Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}