Skip to content

Embedded PostgreSQL tests fail on non-ASCII Windows locale names #35

Description

@jervaise

Problem

The embedded PostgreSQL test fixture cannot start on Windows systems whose OS locale name contains non-ASCII characters.

Evidence

On a tr-TR host, every database-backed focused test fails in the session fixture before migrations. EmbeddedPostgres.start() retries five times and then raises because initdb rejects:

locale name "Turkish_Türkiye.1252" contains non-ASCII characters

Setting LC_ALL=C LANG=C for the pytest process does not override the Windows locale selected by pg0.exe. Pure mock-connection tests pass.

Assumed

The bundled pg0 fixture starts an isolated test cluster independent of the operator's localized Windows display name.

True

pg0.exe launches initdb without an explicit ASCII locale, so localized Windows locale names can make every DB-backed test unavailable.

Expected

The embedded test cluster should pass an explicit supported locale such as C, or expose a fixture/constructor option that does so, while leaving production locale behavior unchanged.

Environment

Hindsight main, Python 3.11.9, pg0 embedded fixture, Windows with system locale tr-TR.

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