test: Ignore UTF-8 errors in assert_debug_log #28035

pull maflcko wants to merge 3 commits into bitcoin:master from maflcko:2307-test-utf8- changing 2 files +6 −6
  1. maflcko commented at 10:13 AM on July 6, 2023: member

    Fix two bugs, see commit messages.

  2. DrahtBot commented at 10:13 AM on July 6, 2023: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK theStack

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. DrahtBot added the label Tests on Jul 6, 2023
  4. DrahtBot added the label CI failed on Jul 6, 2023
  5. maflcko force-pushed on Jul 6, 2023
  6. maflcko force-pushed on Jul 6, 2023
  7. DrahtBot removed the label CI failed on Jul 6, 2023
  8. fanquake requested review from theStack on Jul 7, 2023
  9. www222fff commented at 5:44 AM on July 10, 2023: none

    Is this fix applied to both for python2 and python3?

  10. fanquake commented at 8:09 AM on July 10, 2023: member

    Is this fix applied to both for python2 and python3?

    We only support Python 3.

  11. maflcko added this to the milestone 26.0 on Jul 14, 2023
  12. test: Fix debug_log_size helper
    debug_log_bytes returned "an opaque number when in text mode"
    (https://docs.python.org/3/tutorial/inputoutput.html#methods-of-file-objects),
    not the number of bytes.
    
    Fix this by using binary mode or text mode (with the same encoding)
    consistently when opening the file for ftell() and read().
    fa63326fbc
  13. test: Ignore UTF-8 errors in assert_debug_log
    read() fails in text mode when the unicode hasn't been fully written
    yet. Fixes: "wallet_importdescriptors.py: can't decode bytes in position
    228861-228863: unexpected end of data"
    (https://github.com/bitcoin/bitcoin/issues/28030)
    fa6bb85cd2
  14. lint: Ignore check_fileopens failure on **kwargs
    This fixes a bug in the linter:
    
    """
    Python's open(...) seems to be used to open text files without explicitly specifying encoding='utf8':
    test/functional/test_framework/test_node.py:        with open(self.debug_log_path, **kwargs) as dl:
    """
    fa3d72960b
  15. maflcko force-pushed on Jul 20, 2023
  16. maflcko commented at 12:46 PM on July 20, 2023: member

    Split into more commits

  17. theStack approved
  18. theStack commented at 8:03 PM on July 25, 2023: contributor

    utACK fa3d72960bc86319aa8b838e3df4e833f845c71f

    Changes look correct to me and should fix #28030. (Background information for other reviewers: wait_for_debug_log was changed to open the debug file in binary mode in PR #25294)

  19. fanquake merged this on Jul 26, 2023
  20. fanquake closed this on Jul 26, 2023

  21. maflcko deleted the branch on Jul 26, 2023
  22. sidhujag referenced this in commit 15c76989ff on Aug 9, 2023
  23. kwvg referenced this in commit 7ea387eab2 on Aug 24, 2023
  24. bitcoin locked this on Jul 25, 2024
Labels

Milestone
26.0


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-24 09:14 UTC

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