mirror of
https://github.com/aljazceru/gpt-engineer.git
synced 2025-12-20 06:05:12 +01:00
add multi-language support for file read
This commit is contained in:
4
db.py
4
db.py
@@ -10,11 +10,11 @@ class DB:
|
|||||||
os.makedirs(self.path, exist_ok=True)
|
os.makedirs(self.path, exist_ok=True)
|
||||||
|
|
||||||
def __getitem__(self, key):
|
def __getitem__(self, key):
|
||||||
with open(self.path / key) as f:
|
with open(self.path / key, encoding='utf-8') as f:
|
||||||
return f.read()
|
return f.read()
|
||||||
|
|
||||||
def __setitem__(self, key, val):
|
def __setitem__(self, key, val):
|
||||||
with open(self.path / key, 'w') as f:
|
with open(self.path / key, 'w', encoding='utf-8') as f:
|
||||||
f.write(val)
|
f.write(val)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user