KristoferFangrat opened a new issue, #73525:
URL: https://github.com/apache/airflow/issues/73525

   ### Under which category would you file this issue?
   
   Airflow Core
   
   ### Apache Airflow version
   
   main checkout at commit 49674b776d
   
   ### What happened and how to reproduce it?
   
   On Windows, running a focused provider test can fail during pytest 
collection before any tests are collected. The tests_common.pytest_plugin 
invokes scripts/ci/prek/update_providers_dependencies.py, which reads UTF-8 
project files with Path.read_text() without an explicit encoding. With the 
Windows cp1252 locale this raises UnicodeDecodeError.
   
   Observed error:
   
   ```text
   UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position ...
   ...
   subprocess.CalledProcessError: ... update_providers_dependencies.py
   ```
   
   The failure occurs before the test file runs.
   
   ### What you think should happen instead?
   
   Airflow's provider dependency refresh and pytest collection should read 
repository files as UTF-8 explicitly and work on Windows without requiring a 
locale override.
   
   ### Operating System
   
   Windows 11
   
   ### Deployment
   
   None
   
   ### Apache Airflow Provider(s)
   
   _No response_
   
   ### Versions of Apache Airflow Providers
   
   Airflow main checkout (2026-09-22), Python 3.11, pytest 9.1.1
   
   ### Official Helm Chart version
   
   Not Applicable
   
   ### Kubernetes Version
   
   _No response_
   
   ### Helm Chart configuration
   
   _No response_
   
   ### Docker Image customizations
   
   _No response_
   
   ### Anything else?
   
   Reproduction on Windows with a non-UTF-8 default locale:
   
   ```bat
   set PYTHONUTF8=0
   set PYTHONPATH=devel-common/src;providers/google/src
   .venv\Scripts\python.exe -m pytest 
providers/google/tests/unit/google/cloud/operators/test_stackdriver.py -q
   ```
   
   Pytest collection fails before tests run. Setting PYTHONUTF8=1 allows 
collection to progress, which points to locale-dependent file reads.
   
   Relevant files:
   - devel-common/src/tests_common/pytest_plugin.py
   - scripts/ci/prek/update_providers_dependencies.py
   
   Both contain repository-file reads without an explicit UTF-8 encoding. 
GitHub search found no existing Airflow issue for this exact Windows/cp1252 
failure.
   
   Are you willing to submit a PR?
   - [x] Yes
   
   Code of Conduct:
   - [x] I agree to follow the project's Code of Conduct.
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


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

Reply via email to