Skip to content

Conversation

@holtvogt
Copy link
Contributor

Addresses an issue in the do_detect_encoding method where an AttributeError occurs if from_path(filename).best() returns None. The fix ensures that the default encoding (latin-1) is used as a fallback in such cases, and preventing crashes during encoding detection.

Fixes #277

@weibullguy weibullguy merged commit d526a94 into PyCQA:master May 11, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AttributeError: 'NoneType' object has no attribute 'encoding' (from_path(filename).best().encoding)

2 participants