cdgriffith / puremagic

Pure python implementation of identifying files based off their magic numbers
MIT License
158 stars 34 forks source link

Update main.py to resolve PYTHONWARNDEFAULTENCODING #61

Closed NebularNerd closed 4 months ago

NebularNerd commented 5 months ago

Closes #60

Adds encoding="utf-8" to line 76 to resolve PYTHONWARNDEFAULTENCODING warning. Per the following:

It's something added in to Python 3.10 to help ensure text-based files are treated as UTF-8 for broader cross-platform compatibility. After Python 3.15 encoding="utf-8" will become the default, but leaving it in the code will not cause any issues.

Tested under windows by using set PYTHONWARNDEFAULTENCODING=1 before running, no errors appeared so should all be good.