Skip to content

Conversation

@laanwj
Copy link
Member

@laanwj laanwj commented Sep 29, 2016

These are text files but their encoding does not depend on the locale. Not all of them require utf8 but it is better to fix it at something to remove potential unpredictability.

This is necessary on FreeBSD where no locale is set by default, and apparently Python defaults not only the terminal encoding to the locale but that of every text file. So without LOCALE environment it defaults text file encoding to ASCII. This causes problems with e.g. bitcoin.conf.

Luckily the locale doesn't affect the default encoding for str.encode() and bytes.decode() on Python 3, so this is the only change necessary.

These are text files but their encoding does not depend on the locale.
Not all of them require utf8 but it is better to fix it at something
to remove potential unpredictability.

This is necessary on FreeBSD where no locale is set by default,
and apparently Python defaults not only the terminal encoding to the locale
but that of every text file. So without LOCALE environment it defaults text
file encoding to ASCII. This causes problems with e.g. `bitcoin.conf`.

Luckily the locale doesn't affect the default encoding for str.encode() and
bytes.decode() on Python 3, so this is the only change necessary.
@laanwj laanwj added the Tests label Sep 29, 2016
@maflcko
Copy link
Member

maflcko commented Sep 29, 2016

utACK 30930e8

@laanwj laanwj merged commit 30930e8 into bitcoin:master Sep 30, 2016
laanwj added a commit that referenced this pull request Sep 30, 2016
…files

30930e8 test: Explicitly set encoding to utf8 when opening text files (Wladimir J. van der Laan)
maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request Oct 3, 2016
These are text files but their encoding does not depend on the locale.
Not all of them require utf8 but it is better to fix it at something
to remove potential unpredictability.

This is necessary on FreeBSD where no locale is set by default,
and apparently Python defaults not only the terminal encoding to the locale
but that of every text file. So without LOCALE environment it defaults text
file encoding to ASCII. This causes problems with e.g. `bitcoin.conf`.

Luckily the locale doesn't affect the default encoding for str.encode() and
bytes.decode() on Python 3, so this is the only change necessary.

Github-Pull: bitcoin#8840
Rebased-From: 30930e8
codablock pushed a commit to codablock/dash that referenced this pull request Jan 12, 2018
…g text files

30930e8 test: Explicitly set encoding to utf8 when opening text files (Wladimir J. van der Laan)
codablock added a commit to codablock/dash that referenced this pull request Feb 1, 2018
bitcoin#8840: test: Explicitly set encoding to utf8 when opening text files
andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
…g text files

30930e8 test: Explicitly set encoding to utf8 when opening text files (Wladimir J. van der Laan)
andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
bitcoin#8840: test: Explicitly set encoding to utf8 when opening text files
CryptoCentric pushed a commit to absolute-community/absolute that referenced this pull request Feb 28, 2019
bitcoin#8840: test: Explicitly set encoding to utf8 when opening text files
@str4d str4d mentioned this pull request Nov 9, 2020
zkbot added a commit to zcash/zcash that referenced this pull request Nov 10, 2020
Lint fixes

Fixes most lints currently reported by `test/lint/lint-all.sh`.

Includes changes cherry-picked from the following upstream PRs:
- bitcoin/bitcoin#8700
- bitcoin/bitcoin#8840
- bitcoin/bitcoin#9867
  - We backported the second commit in #3146
- bitcoin/bitcoin#10771
- bitcoin/bitcoin#11394
- bitcoin/bitcoin#11649
- bitcoin/bitcoin#17329
- bitcoin/bitcoin#19258
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants