-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
util: escape C1 control characters and switch to hex format #29826
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows test failure in test-fs-whatwg-url is relevant.
AssertionError [ERR_ASSERTION]: Expected "actual" to be reference-equal to "expected":
+ actual - expected
Comparison {
code: 'ERR_INVALID_ARG_VALUE',
+ message: "The argument 'path' must be a string or Uint8Array without null bytes. Received 'c:\\\\tmp\\\\\\x00test'",
- message: "The argument 'path' must be a string or Uint8Array without null bytes. Received 'c:\\\\tmp\\\\\\u0000test'",
type: [Function: TypeError]
}
at new AssertionError (internal/assert/assertion_error.js:418:11)
at Object.innerFn (c:\workspace\node-test-binary-windows-2\test\common\index.js:617:15)
at expectedException (assert.js:642:26)
at expectsError (assert.js:767:3)
at Function.throws (assert.js:816:3)
at Object.expectsError (c:\workspace\node-test-binary-windows-2\test\common\index.js:629:12)
at Object.<anonymous> (c:\workspace\node-test-binary-windows-2\test\parallel\test-fs-whatwg-url.js:58:10)
at Module._compile (internal/modules/cjs/loader.js:946:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:963:10)
at Module.load (internal/modules/cjs/loader.js:797:32) {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: [NodeError],
expected: [Object],
operator: 'common.expectsError'
}
@nodejs/citgm-admins Is it just me or do the Window results not seem to report their failures in the |
@Trott fixed. I also fixed two faulty escape entries. PTAL |
C1 control characters will from now on also be escaped to prevent altering the terminal behavior. Fixes: nodejs#29450
500466d
to
a67e268
Compare
Landed in 0f78dcc |
Escaped in what contexts? Is it just in format string interpolation? Being able to use control characters to control the terminal is a feature, I assume this won't break CLI apps with interactive features, or there would be an uproar, but I don't know why. |
C1 control characters will from now on also be escaped to prevent
altering the terminal behavior.
This also switches '\u00XX' to '\xXX' as suggested by @dd-pardal. The reason for me to switch is that it uses less characters.
Fixes: #29450
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes