bito-code-review[bot] commented on PR #41828:
URL: https://github.com/apache/superset/pull/41828#issuecomment-4954136536

   <!-- Bito Reply -->
   The suggestion to use `encoding="utf-8"` when opening `.po` and `.pot` files 
is correct. Python's default `open()` uses the system locale, which can cause 
`UnicodeDecodeError` or corruption on non-UTF-8 systems when processing 
translation files that contain non-ASCII characters.
   
   To resolve this, update the file opening calls in 
`scripts/translations/babel_update.sh` to explicitly specify the encoding:
   
   ```python
   # Replace lines 23 and 35 in scripts/translations/babel_update.sh:
   lines = open(path, encoding="utf-8").readlines()
   # ...
       open(path, "w", encoding="utf-8").writelines(lines)
   ```
   
   Would you like me to fetch all other comments on this PR to validate and 
implement fixes for them as well?
   
   **scripts/translations/babel_update.sh**
   ```
   lines = open(path, encoding="utf-8").readlines()
       # ...
       if changed:
           open(path, "w", encoding="utf-8").writelines(lines)
   ```


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to