useblocks / sphinx-test-reports

Documents test-results inside Sphinx
https://sphinx-test-reports.readthedocs.io/en/latest/
MIT License
28 stars 21 forks source link

test_report_template encoding depends on system #60

Closed kreuzberger closed 1 year ago

kreuzberger commented 1 year ago

Writing the test_report_template for the report works on linux but seems broken on windows for Latin1 encodings.

My test_report_template is written in German with German Umlaute and the file encoding is utf-8.

In the file sphinxcontrib/test_reports/directives/test_report.py this is opened without encoding information and i assume it opens it with system encoding (utf8 on linux, latin1 or window cpxxxx). This breaks the handling on both platforms.

Best would be to open the file ALWAYS with utf8 encoding or make in a configuration value.

danwos commented 1 year ago

Thanks for the bug report. :+1:

I agree we should always use utf8 to open/write all files. But this should be just the default configuration, so the user should be able to overwrite this by a config_parameter like test_report_import_encoding.

elupus commented 1 year ago

Looks to be solved?

danwos commented 1 year ago

Yes, solved. Thanks for the hint :+1: