Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Prevent warnings about encoding from preventing transfer of errors #575

Merged
merged 1 commit into from
Apr 18, 2023

Conversation

JonRowe
Copy link
Member

@JonRowe JonRowe commented Apr 12, 2023

With rspec-rails using in_sub_process regularly masks errors by causing this internal error:

DEPRECATION WARNING: some output
 (called from block (3 levels) in <top (required)> at /home/runner/work/rspec-rails/rspec-rails/spec/rspec/rails/configuration_spec.rb:168)
/home/runner/work/rspec-rails/rspec-support/lib/rspec/support/spec/in_sub_process.rb:25:in `write': "\x98" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)

Which in turn masks the error as:

ArgumentError:
       marshal data too short

This fixes that and raises the proper error (in this case about the warnings about being present)

I tried to write a test for this but the encoding worked with all the invalid samples I can come up with, if someone can create one please feel free to add it.

Copy link
Member

@pirj pirj left a comment

Choose a reason for hiding this comment

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

Inventive!
Eager to see it in action.
Thank you.

@pirj pirj merged commit 6d33eaa into main Apr 18, 2023
@pirj pirj deleted the sub-process-binary branch April 18, 2023 20:03
JonRowe pushed a commit that referenced this pull request Feb 4, 2024
Prevent warnings about encoding from preventing transfer of errors
JonRowe added a commit that referenced this pull request Feb 4, 2024
JonRowe added a commit that referenced this pull request Feb 4, 2024
@JonRowe
Copy link
Member Author

JonRowe commented Feb 4, 2024

This has been released in 3.12.2

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants