Skip to content

[BUG] Author field in apm.yml is not being properly filled due to unicode escaping #387

@alopezsanchez

Description

@alopezsanchez

Describe the bug
When apm init (or apm install in zero-config mode) auto-detects the git user.name and writes the author field to apm.yml, non-ASCII characters are escaped as \xNN sequences instead of being written as proper UTF-8.

For example, a git user named Alejandro López Sánchez produces:

author: "Alejandro L\xF3pez S\xE1nchez"

This is caused by PyYAML's yaml.safe_dump() / yaml.dump() defaulting to allow_unicode=False, which forces ASCII-safe escaping regardless of file encoding.
The same issue affects any code path that re-writes apm.yml (install, uninstall, script runner), since round-tripping through PyYAML without allow_unicode=True will re-escape any non-ASCII content.

To Reproduce

  1. Configure git with a non-ASCII name: git config user.name "Alejandro López Sánchez"
  2. Run apm init --yes in a new directory
  3. Open the generated apm.yml
  4. The author field contains escaped sequences: "Pepe Rodríguez"

Expected behavior
The author field should contain the actual UTF-8 characters:

author: Alejandro López Sánchez

Environment (please complete the following information):

  • OS: Any (reproduced on macOS)
  • Python Version: 3.12
  • APM Version: 0.8.3
  • VSCode Version: N/A

Logs
No error is raised — the YAML is technically valid, but the human-readable content is garbled.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedDirection approved, safe to start workbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions