Skip to content

Commit f80825f

Browse files
committed
fix weird behaviour during updating records
1 parent 3664a3b commit f80825f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

main.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def update_records(issue, issue_number=None):
3636
issue_labels = ["`" + label["name"] + "`" for label in issue["labels"]]
3737
issue_link = issue["html_url"]
3838

39-
with open("DailyLC.md", "r+") as file:
39+
with open("DailyLC.md", "r") as file:
4040
lines = file.readlines()
4141

4242
table_start_index = None
@@ -56,8 +56,9 @@ def update_records(issue, issue_number=None):
5656
else:
5757
lines.insert(table_start_index, new_line)
5858

59-
file.seek(0)
59+
with open('DailyLC.md', 'w') as file:
6060
file.writelines(lines)
61+
file.close()
6162

6263
return "Successfully updated Records of DailyLC.md"
6364

0 commit comments

Comments
 (0)