mirror of
https://github.com/aljazceru/gpt-engineer.git
synced 2025-12-18 21:25:11 +01:00
Merge pull request #23 from JackLeeHal/main
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)
|
||||
|
||||
def __getitem__(self, key):
|
||||
with open(self.path / key) as f:
|
||||
with open(self.path / key, encoding='utf-8') as f:
|
||||
return f.read()
|
||||
|
||||
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)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user