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.
Problem
The embedded PostgreSQL test fixture cannot start on Windows systems whose OS locale name contains non-ASCII characters.
Evidence
On a
tr-TRhost, every database-backed focused test fails in the session fixture before migrations.EmbeddedPostgres.start()retries five times and then raises becauseinitdbrejects:Setting
LC_ALL=C LANG=Cfor the pytest process does not override the Windows locale selected bypg0.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.exelaunchesinitdbwithout 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.