test: Explicitly set encoding to utf8 when opening text files #8840

pull laanwj wants to merge 1 commits into bitcoin:master from laanwj:2016_09_textfiles_locale changing 7 files +12 −12
  1. laanwj commented at 4:05 PM on September 29, 2016: member

    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.

  2. test: Explicitly set encoding to utf8 when opening text files
    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.
    30930e847e
  3. laanwj added the label Tests on Sep 29, 2016
  4. MarcoFalke commented at 4:12 PM on September 29, 2016: member

    utACK 30930e847e2483c7c8163cc581b392bc288250e9

  5. MarcoFalke added the label Refactoring on Sep 29, 2016
  6. MarcoFalke removed the label Refactoring on Sep 29, 2016
  7. laanwj merged this on Sep 30, 2016
  8. laanwj closed this on Sep 30, 2016

  9. laanwj referenced this in commit 929860106f on Sep 30, 2016
  10. MarcoFalke referenced this in commit cbc3fe59c4 on Oct 3, 2016
  11. codablock referenced this in commit 14272268dd on Sep 19, 2017
  12. codablock referenced this in commit 942fe0ed49 on Jan 12, 2018
  13. codablock referenced this in commit 47d31649f7 on Jan 31, 2018
  14. codablock referenced this in commit 102a6c6a34 on Jan 31, 2018
  15. codablock referenced this in commit 29b52b55e7 on Jan 31, 2018
  16. codablock referenced this in commit a92b7b2ede on Feb 1, 2018
  17. andvgal referenced this in commit a5b1ec66a6 on Jan 6, 2019
  18. andvgal referenced this in commit 3095d7487d on Jan 6, 2019
  19. CryptoCentric referenced this in commit 29884fc6ac on Feb 28, 2019
  20. zkbot referenced this in commit caed4adf50 on Nov 10, 2020
  21. MarcoFalke locked this on Sep 8, 2021
Contributors
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 15:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me