Skip to content

init: set PYTHONUTF8=1 for Python services (Windows reads files as cp1252) #464

Closed

Description

@7schmiede

What happens

On Windows a native Python service reads text files as the ANSI code page (cp1252) unless told otherwise: open(path) without encoding= uses locale.getpreferredencoding(). In the containers the same code runs on Linux with UTF-8, so the problem shows only under devstack.

Seen while setting up a Python stack: a seed job read its UTF-8 JSON fixtures as cp1252, every umlaut became mojibake, and the documents failed a downstream quality check. Nothing in the output pointed at the encoding.

Proposal

  • devstack init, for the Python apps it detects (Django, FastAPI, Flask), writes PYTHONUTF8 = "1" into the service's env (it is harmless on Linux and macOS, where UTF-8 is the default already), with a short comment why.
  • And/or the stack file reference (or the devstack-config skill) names it as a Windows pitfall for native Python services and jobs.

Environment

devstack 0.40.0, Windows 11, Python 3.12.

Activity

  1. added
    enhancement
    on Nov 5, 2026
  2. added a commit that references this issue on Nov 6, 2026
    ecb4a17
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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions