Skip to content

mkconcore.py fails on filenames with multiple dots due to fragile extension parsing #283

@avinxshKD

Description

@avinxshKD

The script uses naive .split(".") parsing throughout to extract filename and extension, which breaks on any source file containing multiple dots (e.g., data.processor.py, model.v2.cpp).

Root cause:

Line 592 (and ~21 other locations) does:

dockername, langext = sourcecode.split(".")

This assumes filenames contain exactly one dot. When sourcecode = "data.processor.py", the split returns ["data", "processor", "py"], causing the tuple unpack to raise ValueError: too many values to unpack.

Affected code paths:

  • Docker workflow generation (lines 590-830): build, run, stop, clear, maxtime, params, unlock scripts

  • POSIX/Windows workflow generation (lines 845-940): build script file copying and compilation

  • POSIX/Windows execution scripts (lines 1030-1100): run and debug command generation

The pattern repeats 22 times across loops that generate shell commands for each node in the workflow graph. Since the failure occurs during the initial script generation phase, mkconcore exits before creating any output.

Proposed fix:

Replace all instances with os.path.splitext():

dockername, ext_with_dot = os.path.splitext(sourcecode)
langext = ext_with_dot[1:]  # Remove leading dot

Alternatively, use sourcecode.rsplit(".", 1) to split from the right, though splitext is more robust for edge cases (hidden files, paths with dots, etc.).

This has not surfaced in testing because all example workflows use simple single-dot filenames. However, it's a blocker for any real-world usage where versioned scripts or namespaced modules are common.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions