util: escape C1 control characters and switch to hex format#29826
Closed
BridgeAR wants to merge 1 commit intonodejs:masterfrom
Closed
util: escape C1 control characters and switch to hex format#29826BridgeAR wants to merge 1 commit intonodejs:masterfrom
BridgeAR wants to merge 1 commit intonodejs:masterfrom
Conversation
Collaborator
addaleax
approved these changes
Oct 3, 2019
jasnell
approved these changes
Oct 3, 2019
targos
approved these changes
Oct 4, 2019
Trott
previously requested changes
Oct 11, 2019
Member
Trott
left a comment
There was a problem hiding this comment.
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'
}
Member
|
@nodejs/citgm-admins Is it just me or do the Window results not seem to report their failures in the |
Member
Author
|
@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
addaleax
pushed a commit
that referenced
this pull request
Nov 19, 2019
C1 control characters will from now on also be escaped to prevent altering the terminal behavior. Fixes: #29450 PR-URL: #29826 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
Member
|
Landed in 0f78dcc |
Contributor
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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