Skip to content

Commit

Permalink
Use String#b to create a mutable binary string (#6559)
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot authored Dec 20, 2024
1 parent 2a331a7 commit 0344faf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/sidekiq/job_retry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def process_retry(jobinst, msg, queue, exception)

m = exception_message(exception)
if m.respond_to?(:scrub!)
m.force_encoding("utf-8")
m.force_encoding(Encoding::UTF_8)
m.scrub!
end

Expand Down
3 changes: 1 addition & 2 deletions test/profiling_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@
assert_equal %w[bob-5678 mike-1234], profiles.map(&:key)
assert_equal %w[5678 1234], profiles.map(&:jid)

header = +"\x1f\x8b"
header.force_encoding("BINARY")
header = "\x1f\x8b".b
profiles.each do |pr|
assert pr.started_at
assert_operator pr.size, :>, 2
Expand Down

0 comments on commit 0344faf

Please sign in to comment.