The PYTHONUTF8 environment variable is defined in PEP 540, and it is actually used in our CI: https://github.com/bitcoin/bitcoin/blob/5e3380b9f59481fc18e05b9d651c3c733abe4053/.cirrus.yml#L89
This PR documents such usage to avoid users' errors.
The PYTHONUTF8 environment variable is defined in PEP 540, and it is actually used in our CI: https://github.com/bitcoin/bitcoin/blob/5e3380b9f59481fc18e05b9d651c3c733abe4053/.cirrus.yml#L89
This PR documents such usage to avoid users' errors.
cr ACK c427a5800bb53208d30eeb03a73ab8be879e5f45
I'm kind of surprised that we need it, because we jumped through quite some hoops to force UTF-8 everywhere (e.g. even adding encoding='utf-8' to open calls explicitly). But yes if we use it in CI it should be documented.
From what I understand is that Windows is one of the few that doesn't use Unicode locale by default. According to the PEP, this can be enforced on the python side:
"use the utf-8 encoding, regardless of the locale currently set by the current platform, and"
Right, this is really the sledgehammer option. I was hoping we didn't need it because we overrode all the specific occurrences where there was a doubt about character set. But apparently not, so we need it.