Eason09053360 commented on code in PR #73679:
URL: https://github.com/apache/airflow/pull/73679#discussion_r4118448460
##########
scripts/ci/prek/common_prek_utils.py:
##########
Review Comment:
The read at line 229 is now UTF-8, but this write still uses the locale
encoding, which makes this worse on Windows. Today cp1252 writes back the same
bytes it read. With a UTF-8 read, rewriting `pyproject.toml` turns each `—`
into byte `0x97` (invalid UTF-8), and rewriting `AGENTS.md` fails with
`UnicodeEncodeError` on `→`.
```suggestion
file_path.write_text(new_content, encoding="utf-8")
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]