Skip to content

Windows: mkconcore mis-reads and then crashes on non-ASCII node names (text files opened without an encoding) #706

Open

Description

@yadavchiragg

mkconcore.py opens its text files (the GraphML, the generated build/run/debug scripts, .iport/.oport, Dockerfile templates) without an encoding, so on Windows they use the system code page (cp1252). A workflow with non-ASCII node names such as ctrl_é.py or плант.py then breaks in two ways:

  1. The UTF-8 GraphML is read as cp1252, so names turn into mojibake ("плант.py") and the build logs "Script ... not found in sourcedir".
  2. Once the names are read correctly, writing the generated scripts fails with UnicodeEncodeError ('charmap' codec can't encode characters) at fbuild.write('mkdir '+containername).

Same root cause as #666 (BOM read as ""). I reproduced both by running mkconcore with a cp1252 default for open(). Proposal: read the GraphML as utf-8-sig and use encoding="utf-8" for every text file mkconcore opens. ASCII-only output is unchanged. I have a fix and a test ready.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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