Skip to content

Commit 48151d6

Browse files
chuwei-dev楚伟
andauthored
Fix UnicodeEncodeError by using UTF-8 encoding for migration files (closes tortoise#2096) (tortoise#2097)
* Fix UnicodeDecodeError when loading migration files * Fix UnicodeDecodeError when loading migration files * style: fix ruff formatting --------- Co-authored-by: 楚伟 <395150457@qq.com>
1 parent fe73270 commit 48151d6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tortoise/migrations/writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def path(self) -> Path:
263263

264264
def write(self) -> Path:
265265
path = self.path()
266-
path.write_text(self.as_string(), encoding="ascii")
266+
path.write_text(self.as_string(), encoding="utf-8")
267267
return path
268268

269269
def as_string(self) -> str:

0 commit comments

Comments
 (0)