allenai / python-package-template

A template repo for Python packages
Apache License 2.0
395 stars 67 forks source link

Specify encoding='utf-8' in Path.open() calls in personalize_file() #81

Closed akshaya-a closed 1 year ago

akshaya-a commented 1 year ago

🐛 Describe the bug

by default, the open() command in text mode ('t') will use the platform encoding, which on windows happens to not be utf-8. In your case as the content is known to be utf-8, a simple fix would be to specify the encoding= kwarg on open()

Versions

python 3.9, latest template

epwalsh commented 1 year ago

Thanks @akshaya-a, just pushed a fix