Skip to content

Commit dc66810

Browse files
committed
fix for W11 when using overview
1 parent 75451ec commit dc66810

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎src/codeaudit/totals.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,11 @@ def count_lines_iterate(filepath):
9595
"""
9696
Counts the number of lines in a file by iterating through the file object.
9797
This method is memory-efficient for large files.
98+
filepath is a Python file, so a text file
9899
"""
99100
count = 0
100101
try:
101-
with open(filepath, "r") as f:
102+
with open(filepath, "r", encoding="utf-8") as f:
102103
for line in f:
103104
count += 1
104105
return count

0 commit comments

Comments
 (0)