Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Silence warnings during tty detection#43149
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
carsonbot commentedSep 24, 2021
Hey! I think@greg0ire has recently worked with this code. Maybe they can help review this? Cheers! Carsonbot |
stof commentedSep 24, 2021
@neclimdul please also report that to PHP. I think the behavior deserved being fixed in PHP, even if we can work around it. |
neclimdul commentedSep 24, 2021
Sure thing. Not sure this sort of thing will get a lot of attention but it would be a good fix in some future version of PHP. |
nicolas-grekas commentedJan 26, 2022 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Can you please target 4.4, and fix all calls to the function (there are more in the codebase)? |
0856749 to3dc53a4Comparenicolas-grekas commentedJan 26, 2022
Thank you@neclimdul. |
neclimdul commentedJan 26, 2022
sorry i didn't see the note about the target. thanks for taking care of this! |
Uh oh!
There was an error while loading.Please reload this page.
When the DeprecationErrorHandler checks if it should colorize the output, in certain circumstances it can trigger the following warning:
This is triggered by some admittedly poor behavior inside of php.
stream_isattychecks by doing a cast and looking for a failure and one of those failures logs a warning. You generally don't want to trigger warnings during a capabilities check(that's why I'm filing this) but PHP is doing just that.This can lead to test suite failures since warnings are generally treated as failures by most test suites.
I think a test case to trigger the deprecation handler might be tricky but a simplified test case to trigger the warning in php looks like this.
https://3v4l.org/0EHT4
A real world example of a test suite that is wrapping stdout with a stream wrapper during testing is Drupal.Feature addition
References:
stream_isatty definition
cast line that triggers warning