New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

flake8-file-encoding

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flake8-file-encoding

A Flake8 plugin to check for files opened without an explicit encoding

  • 0.1.0
  • PyPI
  • Socket score

Maintainers
1

flake8-file-encoding

A Flake8 plugin to check for files opened without an explicit encoding.

Why check for encoding arguments?

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.

Installation

pip install flake8-file-encoding

Usage

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.

Errors

CodeMessage
FEN001open() call has no encoding argument

Keywords

FAQs


Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc