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

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
29 checks passed
@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants