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

Fixes exception during HandshakeException handler #27791

Merged
merged 1 commit into from Feb 26, 2021
Merged

Fixes exception during HandshakeException handler #27791

merged 1 commit into from Feb 26, 2021

Conversation

arenevier
Copy link
Contributor

Make sure we pass only one argument to logger.info

Fixes #27785

Make sure we pass only one argument to logger.info

Fixes #27785
@arenevier
Copy link
Contributor Author

Something we could do instead (or additionally), to prevent that from happening again is to modify NoOpLogger methods signatures to accept multiple arguments (ie def info(self, *msg))

@arenevier
Copy link
Contributor Author

Copy link
Contributor

@ricea ricea left a comment

Choose a reason for hiding this comment

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

lgtm

@stephenmcgruer
Copy link
Contributor

Something we could do instead (or additionally), to prevent that from happening again is to modify NoOpLogger methods signatures to accept multiple arguments (ie def info(self, *msg))

I think that yes, NoOpLogger should have the same signature as the logger we are trying to use (which I believe is just https://docs.python.org/3/library/logging.html ?). So based on e.g. https://docs.python.org/3/library/logging.html#logging.Logger.info, it should be def info(msg, *args, **kwargs), but I'd be interested if @jgraham agrees or knows something otherwise :D

@jgraham
Copy link
Contributor

jgraham commented Feb 26, 2021

The logger can be a mozlog logger which doesn't support he string interpolation feature so unless we change mozlog, the current signature is correct.

@stephenmcgruer
Copy link
Contributor

The logger can be a mozlog logger which doesn't support he string interpolation feature so unless we change mozlog, the current signature is correct.

Ah, that is great to know! So our current log statements should never use the _log.info("string %s", argument) form, then? In which case this PR is 100% correct :)

@stephenmcgruer stephenmcgruer merged commit 4f24e1d into web-platform-tests:master Feb 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exception when handling HandshakeException _stream_ws_thread
5 participants