Read people conversation source tests as UTF-8#7780
Conversation
Greptile SummaryFixes four
Confidence Score: 5/5The change is a one-line fix repeated four times — adding explicit UTF-8 encoding to file reads in a test file — with no impact on production code or test logic. Only test-helper file reads are touched; all existing assertions remain identical. The fix correctly addresses the root cause (implicit OS encoding) and does not introduce any new behaviour or risk. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[pytest on Windows/GBK locale] --> B[open source file]
B -->|Before: no encoding arg| C[OS default encoding e.g. GBK]
B -->|After: encoding='utf-8'| D[UTF-8 decoding]
C -->|non-ASCII byte in file| E[UnicodeDecodeError - test FAIL]
D --> F[source read successfully]
F --> G[assert function/decorator presence]
G --> H[test PASS]
Reviews (1): Last reviewed commit: "Read people conversation source tests as..." | Re-trigger Greptile |
Summary
routers/conversations.pyanddatabase/conversations.pyas UTF-8 intest_people_conversations_500s.pyWindows reproduction
Before this change on Windows with the default GBK locale:
python -m pytest tests\unit\test_people_conversations_500s.py -q-> 3 failed, 11 passed, 1 warningUnicodeDecodeError: 'gbk' codec can't decode byte ...while readingdatabase/conversations.pyTesting
python -m pytest tests\unit\test_people_conversations_500s.py -q-> 14 passed, 1 warningpython -m black --line-length 120 --skip-string-normalization tests\unit\test_people_conversations_500s.py --checkpython -m py_compile tests\unit\test_people_conversations_500s.pygit diff --check --cached