Bug 1774462 Comment 23 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Jens Stutte [:jstutte] from comment #22)
> FWIW: https://treeherder.mozilla.org/jobs?repo=try&revision=add183f82f79fd2b869be279f7cf565759121016

There [is one interesting message](https://treeherder.mozilla.org/logviewer?job_id=392857639&repo=try&lineNumber=5740) in a log:

```
[task 2022-10-11T08:11:36.652Z] 08:11:36     INFO -  TEST-PASS | xpcshell-remote.ini:toolkit/components/extensions/test/xpcshell/test_ext_scripting_persistAcrossSessions.js | test_multiple_extensions_and_scripts - [test_multiple_extensions_and_scripts : 165] expected a single 'script-1.js' js file - Expected: ["script-1.js"], Actual: ["script-1.js"] - true == true
[task 2022-10-11T08:11:36.652Z] 08:11:36     INFO -  mozlog.structuredlog: Failure calling log handler:
[task 2022-10-11T08:11:36.685Z] 08:11:36     INFO -  Traceback (most recent call last):
[task 2022-10-11T08:11:36.685Z] 08:11:36     INFO -    File "Z:\task_166546432437419\build\venv\lib\site-packages\mozlog\structuredlog.py", line 294, in _handle_log
[task 2022-10-11T08:11:36.695Z] 08:11:36     INFO -      handler(data)
[task 2022-10-11T08:11:36.695Z] 08:11:36     INFO -    File "Z:\task_166546432437419\build\venv\lib\site-packages\mozlog\handlers\base.py", line 94, in __call__
[task 2022-10-11T08:11:36.695Z] 08:11:36     INFO -      self.stream.write(formatted)
[task 2022-10-11T08:11:36.695Z] 08:11:36     INFO -    File "c:\mozilla-build\python3\lib\encodings\cp1252.py", line 19, in encode
[task 2022-10-11T08:11:36.696Z] 08:11:36     INFO -      return codecs.charmap_encode(input,self.errors,encoding_table)[0]
[task 2022-10-11T08:11:36.696Z] 08:11:36     INFO -  UnicodeEncodeError: 'charmap' codec can't encode character '\ufffd' in position 244: character maps to <undefined>
```

which seems to indicate that under Windows we write the log file not as UTF-8 but as cp1252 ? Then we should probably make sure that we use the stream's encoding if present instead of directly using "UTF-8" as constant string?
(In reply to Jens Stutte [:jstutte] from comment #22)
> FWIW: https://treeherder.mozilla.org/jobs?repo=try&revision=add183f82f79fd2b869be279f7cf565759121016

There [is one interesting message](https://treeherder.mozilla.org/logviewer?job_id=392857639&repo=try&lineNumber=5740) in a log:

```
[task 2022-10-11T08:11:36.652Z] 08:11:36     INFO -  TEST-PASS | xpcshell-remote.ini:toolkit/components/extensions/test/xpcshell/test_ext_scripting_persistAcrossSessions.js | test_multiple_extensions_and_scripts - [test_multiple_extensions_and_scripts : 165] expected a single 'script-1.js' js file - Expected: ["script-1.js"], Actual: ["script-1.js"] - true == true
[task 2022-10-11T08:11:36.652Z] 08:11:36     INFO -  mozlog.structuredlog: Failure calling log handler:
[task 2022-10-11T08:11:36.685Z] 08:11:36     INFO -  Traceback (most recent call last):
[task 2022-10-11T08:11:36.685Z] 08:11:36     INFO -    File "Z:\task_166546432437419\build\venv\lib\site-packages\mozlog\structuredlog.py", line 294, in _handle_log
[task 2022-10-11T08:11:36.695Z] 08:11:36     INFO -      handler(data)
[task 2022-10-11T08:11:36.695Z] 08:11:36     INFO -    File "Z:\task_166546432437419\build\venv\lib\site-packages\mozlog\handlers\base.py", line 94, in __call__
[task 2022-10-11T08:11:36.695Z] 08:11:36     INFO -      self.stream.write(formatted)
[task 2022-10-11T08:11:36.695Z] 08:11:36     INFO -    File "c:\mozilla-build\python3\lib\encodings\cp1252.py", line 19, in encode
[task 2022-10-11T08:11:36.696Z] 08:11:36     INFO -      return codecs.charmap_encode(input,self.errors,encoding_table)[0]
[task 2022-10-11T08:11:36.696Z] 08:11:36     INFO -  UnicodeEncodeError: 'charmap' codec can't encode character '\ufffd' in position 244: character maps to <undefined>
```

which seems to indicate that under Windows we write the log file not as UTF-8 but as cp1252 ? Then we should probably make sure that we use the stream's encoding if present instead of directly using "utf-8" as constant string?

Back to Bug 1774462 Comment 23