Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false
defaults:
run:
Expand Down
4 changes: 1 addition & 3 deletions cmd2/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,14 +183,12 @@ def is_text_file(file_path: str) -> bool:
:return: True if the file is a non-empty text file, otherwise False
:raises OSError: if file can't be read
"""
import codecs

expanded_path = os.path.abspath(os.path.expanduser(file_path.strip()))
valid_text_file = False

# Only need to check for utf-8 compliance since that covers ASCII, too
try:
with codecs.open(expanded_path, encoding='utf-8', errors='strict') as f:
with open(expanded_path, encoding='utf-8', errors='strict') as f:
# Make sure the file has only utf-8 text and is not empty
if sum(1 for _ in f) > 0:
valid_text_file = True
Expand Down
Loading