mirror of
https://github.com/mvt-project/mvt.git
synced 2026-04-21 11:16:20 +02:00
Set utf-8 as an encoding for open()
Not every system uses 'utf-8' as a default encoding for opening files in Python. Before you say that there must be a way to set default encoding in one line, no, there is not. At least, I didn't found a way to do this.
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
|
||||
import os
|
||||
import sys
|
||||
import importlib
|
||||
|
||||
importlib.reload(sys)
|
||||
print(sys.getdefaultencoding())
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user