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

test262-harness.py complain write error with python3 #4854

Open
lygstate opened this issue Dec 7, 2021 · 0 comments · May be fixed by #4856
Open

test262-harness.py complain write error with python3 #4854

lygstate opened this issue Dec 7, 2021 · 0 comments · May be fixed by #4856

Comments

@lygstate
Copy link
Contributor

lygstate commented Dec 7, 2021

C:\work\study\languages\typescript\jerryscript>python tools/run-tests.py --test262-esnext=update
�[1;34mBuild command:�[0m
�[1;34mC:\Program Files\Python39\python.exe \�[0m
        �[1;34mC:\work\study\languages\typescript\jerryscript\tools\build.py \�[0m
        �[1;34m--profile=es.next \�[0m
        �[1;34m--function-to-string=on \�[0m
        �[1;34m--line-info=on \�[0m
        �[1;34m--error-messages=on \�[0m
        �[1;34m--mem-heap=20480 \�[0m
        �[1;34m--builddir=C:\work\study\languages\typescript\jerryscript\build\tests\test262_tests_esnext \�[0m
        �[1;34m--install=C:\work\study\languages\typescript\jerryscript\build\tests\test262_tests_esnext\local�[0m
�[1;34mTest command:�[0m
�[1;34mTZ='America/Los_Angeles' \�[0m
�[1;34mC:\Program Files\Python39\python.exe \�[0m
        �[1;34mC:\work\study\languages\typescript\jerryscript\tools\runners/run-test-suite-test262.py \�[0m
        �[1;34m--engine \�[0m
        �[1;34mC:\work\study\languages\typescript\jerryscript\build\tests\test262_tests_esnext\local\bin\jerry.exe \�[0m
        �[1;34m--test262-object \�[0m
        �[1;34m--test-dir \�[0m
        �[1;34mC:\work\study\languages\typescript\jerryscript\tests/test262 \�[0m
        �[1;34m--esnext \�[0m
        �[1;34mupdate�[0m
Traceback (most recent call last):
  File "C:\work\study\languages\typescript\jerryscript\tools\runners\test262-harness.py", line 955, in <module>
    sys.exit(main())
  File "C:\work\study\languages\typescript\jerryscript\tools\runners\test262-harness.py", line 945, in main
    code = test_suite.run(options.command, args,
  File "C:\work\study\languages\typescript\jerryscript\tools\runners\test262-harness.py", line 872, in run
    progress.has_run(result)
  File "C:\work\study\languages\typescript\jerryscript\tools\runners\test262-harness.py", line 698, in has_run
    result.report_outcome(True)
  File "C:\work\study\languages\typescript\jerryscript\tools\runners\test262-harness.py", line 453, in report_outcome
    self.write_output(sys.stdout)
  File "C:\work\study\languages\typescript\jerryscript\tools\runners\test262-harness.py", line 467, in write_output
    target.write(u"--- errors ---  \n %s" % error)
UnicodeEncodeError: 'gbk' codec can't encode character '\xab' in position 73: illegal multibyte sequence
.........=== Summary - updating excludelist ===

Excludelist was already up-to-date.

lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 7, 2021
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

Fixes jerryscript-project#4854

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 7, 2021
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

Fixes jerryscript-project#4854

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
@lygstate lygstate linked a pull request Dec 7, 2021 that will close this issue
lygstate added a commit to lygstate/jerryscript that referenced this issue Dec 7, 2021
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

Fixes jerryscript-project#4854

JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant