Skip to content

Backport #1964: Fix Encoding::CompatibilityError in hostnamectl plugin - #1966

Merged
tpowell-progress merged 1 commit into
18-stablefrom
backport-1964-18-stable
Aug 12, 2026
Merged

Backport #1964: Fix Encoding::CompatibilityError in hostnamectl plugin#1966
tpowell-progress merged 1 commit into
18-stablefrom
backport-1964-18-stable

Conversation

@tpowell-progress

Copy link
Copy Markdown
Contributor

Summary

Backport of #1964 to 18-stable. Clean cherry-pick, no conflicts.

Changes Made

  • Cherry-picked commit 54b17dd (coerce hostnamectl stdout to UTF-8 with scrub before regexp)
  • Spec fixtures made binary so emoji regression cases actually exercise the encoding path

Testing

  • spec/unit/plugins/linux/hostnamectl_spec.rb: 10 examples, 0 failures

This work was completed with AI assistance following Progress AI policies

Mixlib::ShellOut returns stdout as ASCII-8BIT, so matching the UTF-8
icon-stripping regexp against it raises as soon as hostnamectl emits a
multibyte character, truncating the attribute mash.

Coerce the encoding before the gsub, and make the existing emoji spec
fixtures binary so they exercise the path they were written to cover.

Signed-off-by: Karl Amrhein <karlamrhein@gmail.com>
Co-authored-by: Karl Amrhein <karlamrhein@gmail.com>
(cherry picked from commit 54b17dd)
Signed-off-by: Thomas Powell <104777878+tpowell-progress@users.noreply.github.com>
@tpowell-progress
tpowell-progress requested review from a team and jaymzh as code owners August 11, 2026 22:49
@tpowell-progress tpowell-progress added the ai-assisted Work completed with AI assistance following Progress AI policies label Aug 11, 2026
@tpowell-progress
tpowell-progress enabled auto-merge (squash) August 11, 2026 22:50
@tpowell-progress
tpowell-progress merged commit 587fca8 into 18-stable Aug 12, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-assisted Work completed with AI assistance following Progress AI policies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants