Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle invalid UTF-8 characters in efibootmgr output #6060

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

KKoukiou
Copy link
Contributor

@KKoukiou KKoukiou commented Dec 19, 2024

Modified the code to handle invalid UTF-8 characters in the output of the efibootmgr command by
using errors="replace". This prevents decode exceptions when encountering non-UTF-8 sequences
in the EFI boot manager output [1].

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2292493#c21
Resolves: rhbz#2254801

@pep8speaks
Copy link

pep8speaks commented Dec 19, 2024

Hello @KKoukiou! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 138:100: E501 line too long (104 > 99 characters)

Comment last updated at 2025-01-08 16:58:07 UTC

@github-actions github-actions bot added the f42 Fedora 42 label Dec 19, 2024
@KKoukiou KKoukiou requested a review from M4rtinK December 19, 2024 14:41
@KKoukiou KKoukiou force-pushed the efibootmgr-nonutf8-tempfix branch from cacb137 to df3b972 Compare December 19, 2024 14:43
@KKoukiou KKoukiou force-pushed the efibootmgr-nonutf8-tempfix branch from df3b972 to a16d4f8 Compare December 19, 2024 14:55
@KKoukiou
Copy link
Contributor Author

@nfrayer can you please share you opinion on this.

@KKoukiou
Copy link
Contributor Author

@M4rtinK seemingly efibootmgr does not promise to return utf-8 only chars. https://bugzilla.redhat.com/show_bug.cgi?id=2292493#c21

So I guess it's fine to introduce this fix.

@KKoukiou KKoukiou force-pushed the efibootmgr-nonutf8-tempfix branch from a16d4f8 to d22483b Compare December 20, 2024 08:37
@M4rtinK
Copy link
Contributor

M4rtinK commented Jan 2, 2025

@M4rtinK seemingly efibootmgr does not promise to return utf-8 only chars. https://bugzilla.redhat.com/show_bug.cgi?id=2292493#c21

So I guess it's fine to introduce this fix.

Agreed, lets use this fix then & thanks for digging deeper into this, its good to have some context. :)

Copy link
Contributor

@M4rtinK M4rtinK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, just adding some improvement suggestions. :)

pyanaconda/core/util.py Outdated Show resolved Hide resolved
pyanaconda/core/util.py Outdated Show resolved Hide resolved
@KKoukiou KKoukiou force-pushed the efibootmgr-nonutf8-tempfix branch from d22483b to 46f3ce5 Compare January 8, 2025 16:16
@KKoukiou KKoukiou force-pushed the efibootmgr-nonutf8-tempfix branch from 46f3ce5 to 6dea007 Compare January 8, 2025 16:25
Modified the code to handle invalid UTF-8 characters in the output of the efibootmgr command by
using `errors="replace"`. This prevents decode exceptions when encountering non-UTF-8 sequences
in the EFI boot manager output [1].

[1] https://bugzilla.redhat.com/show_bug.cgi?id=2292493#c21
Resolves: rhbz#2254801
@KKoukiou KKoukiou force-pushed the efibootmgr-nonutf8-tempfix branch from 6dea007 to 816f494 Compare January 8, 2025 16:58
@KKoukiou
Copy link
Contributor Author

KKoukiou commented Jan 8, 2025

@M4rtinK can you please re-review?

@KKoukiou
Copy link
Contributor Author

/kickstart-tests --testtype uefi

@KKoukiou
Copy link
Contributor Author

/kickstart-tests --testtype smoke

Copy link
Contributor

@M4rtinK M4rtinK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks perfect now, thanks! :)

@KKoukiou KKoukiou merged commit 51d24ed into rhinstaller:main Jan 15, 2025
20 checks passed
@KKoukiou KKoukiou deleted the efibootmgr-nonutf8-tempfix branch January 15, 2025 06:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f42 Fedora 42
Development

Successfully merging this pull request may close these issues.

3 participants