Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
flake8-file-encoding
Advanced tools
A Flake8 plugin to check for files opened without an explicit encoding.
If you don't specify an encoding
argument to the
open function, then
Python will use a platform-dependent default encoding—whatever
locale.getpreferredencoding
returns. On many platforms this is
UTF-8, but on a significant minority it
is something different. For example, the default encoding on Japanese Windows
machines is cp932 (Microsoft's version of
Shift-JIS). If you open a UTF-8 file
on such a system but do not specify an encoding, then attempting to read any
multi-byte characters in the file will cause a UnicodeDecodeError.
pip install flake8-file-encoding
Once this plugin is installed, Flake8 will check for missing encoding
arguments along with its other checks. No special activation for this plugin is
necessary. For more details on running Flake8, see the
Flake8 documentation.
Code | Message |
---|---|
FEN001 | open() call has no encoding argument |
FAQs
A Flake8 plugin to check for files opened without an explicit encoding
We found that flake8-file-encoding demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.