Revise tools scripts to be python3 compatible#4390
Conversation
1400292 to
eadfc48
Compare
c601f35 to
4d8c1c4
Compare
4d8c1c4 to
9b62d37
Compare
|
Do we need it to be able to use our harness for ES5.1 version of test262? If yes, it would be great to mention it in the commit log at least. |
9b62d37 to
119904d
Compare
The CI fails now, must be reviewed again after the patch is fixed.
86b19d5 to
8b9b7c3
Compare
6e61c70 to
2e3c5ff
Compare
|
2e3c5ff to
e9f27c1
Compare
e9f27c1 to
ca29854
Compare
ca29854 to
0070af5
Compare
0070af5 to
8f78592
Compare
2ee3fe9 to
cb37a1c
Compare
cb37a1c to
4ad3082
Compare
4ad3082 to
36e8b35
Compare
|
During the review of the current version of the PR, I've found a potentially useful (and definitely interesting) approach to the problem, which may reduce the necessary code changes considerably. With just two lines of code (per tool), the unicode encode/decode errors can be disabled/hidden/ignored: import codecs
codecs.register_error("strict", codecs.ignore_errors)This would be worth a try. Then, no stdour/err would be necessary, no polluting of the code with encodes/decodes, no |
akosthekiss
left a comment
There was a problem hiding this comment.
Please, edit the commit message. It is unacceptably long. Tracebacks and diagnostics and console logs should not go into a commit message. They belong to the discussion comments of the corresponding PR.
Yeap, I know this method, but the following are still better. codec ignore is just hidden the error when output isatty, but when we do piping, we always using the 'utf8-8' encoding. |
36e8b35 to
d04e74a
Compare
e65a362 to
5b07d2e
Compare
We introduce setup_stdio function to setup stdout/stderr properly. For python <-> python pipe, we always use 'utf8'/'ignore' encoding for not lost characters. For tty <-> python, we using native encoding with xmlcharrefreplace to encode, to preserve maximal information. For python <-> native program, we use naive encoding with 'ignore' to not cause error For reading/writing to file, we use 'utf8' /'ignore' encoding for not lost characters. JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
5b07d2e to
bbd207e
Compare
|
@ossy-szeged any progress of the PR? after this, I can create PR that support python3 debugger |
Revise tools scripts to be python3 compatible
We introduce setup_stdio function to setup stdout/stderr properly.
For python <-> python pipe, we always use 'utf8'/'ignore' encoding for not lost
characters.
For tty <-> python, we using native encoding with xmlcharrefreplace to encode, to
preserve maximal information.
For python <-> native program, we use naive encoding with 'ignore' to not cause error
For reading/writing to file, we use 'utf8' /'ignore' encoding for not lost
characters.
JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com