Skip to content

Conformance - fix issues on Windows (unicode, Pyre) #1976

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

Merged
merged 2 commits into from
Apr 19, 2025

Conversation

Andrej730
Copy link
Contributor

  1. Noticed that pyright is giving unicode output that on Windows is leading to issues generating reports later. Saving this output explicitly as unicode resolves the issue.
  2. Made Pyre optional as it does not support Windows currently (pyre doesn't work under windows facebook/pyre-check#554)
     
    Unicode error traceback:
Generating summary report
Traceback (most recent call last):
  File "\typing\conformance\src\main.py", line 260, in <module>
    main()
  File "\typing\conformance\src\main.py", line 256, in main
    generate_summary(root_dir)
  File "\typing\conformance\src\reporting.py", line 19, in generate_summary
    summary = template.replace("{{summary}}", generate_summary_html(root_dir))
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "\typing\conformance\src\reporting.py", line 87, in generate_summary_html
    results = tomli.load(f)
              ^^^^^^^^^^^^^
  File "src\tomli\_parser.py", line 134, in load
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 110: invalid start byte

Noticed that pyright is giving unicode output that on Windows is leading to issues generating reports later. Saving this output explicitly as unicode resolves the issue.

```python
Generating summary report
Traceback (most recent call last):
  File "\typing\conformance\src\main.py", line 260, in <module>
    main()
  File "\typing\conformance\src\main.py", line 256, in main
    generate_summary(root_dir)
  File "\typing\conformance\src\reporting.py", line 19, in generate_summary
    summary = template.replace("{{summary}}", generate_summary_html(root_dir))
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "\typing\conformance\src\reporting.py", line 87, in generate_summary_html
    results = tomli.load(f)
              ^^^^^^^^^^^^^
  File "src\tomli\_parser.py", line 134, in load
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa0 in position 110: invalid start byte
```
@erictraut erictraut merged commit 2d9ea90 into python:main Apr 19, 2025
4 checks passed
@Andrej730 Andrej730 deleted the conformance-windows branch April 19, 2025 11:10
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 this pull request may close these issues.

2 participants