Skip to content

[🐛 Bug]: JSON encoding warning from Ruby Selenium::WebDriver::Remote::Http::Common #16703

@theDogOfPavlov

Description

@theDogOfPavlov

Description

What I saw:

Due to a recent change in the JSON module, which is a dependency, when a non UTF-8 value reaches Selenium::WebDriver::Remote::Http::Common then a warning is thrown:

warning: JSON.generate: UTF-8 string passed as BINARY, this will raise an encoding error in json 3.0

What I would expect:

Values are encoded as UTF-8 before being passed on to the JSON.generate call, or otherwise if they fail encoding, an error is raised.

Reproducible Code

Selenium::WebDriver::Driver.execute_script( 'return navigator.userAgent;'.force_encoding( Encoding::BINARY ) )

ℹ️ Last known working version: It is an issue with the JSON dependency, which has changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-needs-triagingA Selenium member will evaluate this soon!C-rbRuby BindingsD-firefoxI-defectSomething is not working as intendedI-regressionSomething was working but we "fixed" itOS-linux

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions