fix: add explicit encoding='utf-8' to open() calls for Windows compat#4333
fix: add explicit encoding='utf-8' to open() calls for Windows compat#4333truecallerabreham wants to merge 1 commit into
Conversation
Add encoding='utf-8' to three open() calls that read text files to prevent UnicodeDecodeError crashes on Windows systems with non-UTF-8 system locales (e.g., GBK on Chinese Windows). Fixes traceloop#4286
|
|
📝 WalkthroughWalkthroughTwo files are updated to add UTF-8 encoding fix
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Three open() calls in the codebase read text files without specifying an encoding. On Windows with non-UTF-8 locales (like GBK on Chinese Windows), this blows up with UnicodeDecodeError.
Added encoding=utf-8 to the two calls in the qdrant instrumentation
__init__.py(loading the JSON method lists) and the one ingenerate_evaluator_models.py(reading the Swagger definition). That's it — three characters each, no behavioral change on systems that already default to UTF-8.Existing tests cover the import path that triggers these reads, so passing tests confirms the fix works.
Closes #4286