Skip to content

Commit

Permalink
fix: don't read() within with
Browse files Browse the repository at this point in the history
  • Loading branch information
outloudvi committed Jan 11, 2025
1 parent 61c331b commit 1bb01c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mw2fcitx/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def load_titles_from_file(self, filename, **kwargs):
"remove this parameter (\"file_path\") or provide a readable file"
)
sys.exit(1)
with open(filename, "r", encoding="utf-8").read() as fp:
self.load_titles(fp, limit=limit)
with open(filename, "r", encoding="utf-8") as fp:
self.load_titles(fp.read(), limit=limit)

def fetch_titles(self, **kwargs):
titles = fetch_all_titles(self.api_path, **kwargs)
Expand Down

0 comments on commit 1bb01c3

Please sign in to comment.