Skip to content

Commit

Permalink
Merge pull request #873 from ashleyheath/encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
ewjoachim authored Dec 13, 2023
2 parents 376bcb9 + 08bf5a4 commit 31a7d09
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion procrastinate/contrib/django/migrations_magic.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def list_migration_files() -> Iterable[Tuple[str, str]]:
Returns a list of filenames and file contents for all migration files
"""
return [
(p.name, p.read_text())
(p.name, p.read_text(encoding="utf-8"))
for p in importlib_resources.files("procrastinate.sql.migrations").iterdir()
if p.name.endswith(".sql")
]
Expand Down
2 changes: 1 addition & 1 deletion procrastinate/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def __init__(self, connector: connector_module.BaseConnector):
def get_schema() -> str:
return (
importlib_resources.files("procrastinate.sql") / "schema.sql"
).read_text()
).read_text(encoding="utf-8")

@staticmethod
def get_migrations_path() -> str:
Expand Down
4 changes: 3 additions & 1 deletion procrastinate/sql/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ def parse_query_file(query_file: str) -> Dict["str", "str"]:

def get_queries() -> Dict["str", "str"]:
return parse_query_file(
(importlib_resources.files("procrastinate.sql") / "queries.sql").read_text()
(importlib_resources.files("procrastinate.sql") / "queries.sql").read_text(
encoding="utf-8"
)
)


Expand Down

0 comments on commit 31a7d09

Please sign in to comment.