Skip to content

bug fix: prevent UnicodeDecodeError when opening log file in feature_init.py - #24039

Merged
maflcko merged 1 commit into
bitcoin:masterfrom
sogoagain:2022-01-feature_init-fix
Jan 12, 2022
Merged

maflcko merged 1 commit into
bitcoin:masterfrom
sogoagain:2022-01-feature_init-fix

Conversation

@sogoagain

@sogoagain sogoagain commented Jan 11, 2022 •

Copy link
Copy Markdown
Contributor

Should fix #23989

To fix a bug, I modified feature_init.py to open the log file as a byte stream when opening it.
thank you.

@DrahtBot DrahtBot added the Tests label Jan 11, 2022
@maflcko

maflcko commented Jan 11, 2022

Copy link
Copy Markdown
Member

…eature_init.py

open log file as a raw byte stream in feature_init.py
(fixes #23989)
@sogoagain

Copy link
Copy Markdown
Contributor Author

@maflcko

maflcko commented Jan 12, 2022

Copy link
Copy Markdown
Member

review ACK 9d3e95d

@maflcko
maflcko merged commit db1f04f into bitcoin:master Jan 12, 2022
@sogoagain
sogoagain deleted the 2022-01-feature_init-fix branch April 25, 2022 17:15
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Nov 25, 2022
…og file

Summary:
> open log file as a raw byte stream (fixes [[bitcoin/bitcoin#23989 | core#23989]])

The log file can be read partially while some emoji is being written, causing a UnicodeDecodeError. It did not make sense to decode the file anyway, as the file content is not being used. We read the file only to count the log lines.

This is a backport of [[bitcoin/bitcoin#24039 | core#24039]]

Test Plan: `ninja check-functional`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Differential Revision: https://reviews.bitcoinabc.org/D12617
@bitcoin bitcoin locked and limited conversation to collaborators Apr 25, 2023
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.

feature_init.py issue

3 participants