Skip to main content

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

Code Message
FEN001 open() call has no encoding argument

Metadata

Release files for flake8-file-encoding 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flake8-file-encoding 0.1.0
File Size Uploaded
flake8-file-encoding-0.1.0.tar.gz 2.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for flake8-file-encoding 0.1.0
File Interpreter ABI Platform
flake8_file_encoding-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 5.8 kB

Release files / flake8-file-encoding-0.1.0.tar.gz

Download URL flake8-file-encoding-0.1.0.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e35eb7b1497f5ee980a75031fadf566b1c026f9160643ff0e1c43341ccb7908d
BLAKE2b-256 checksum
How to use checksums
5130de7e57357f5db90ac2f872021825527cc30ada8d96b830486649c5725ee3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.16 CPython/3.7.3 Linux/4.15.0-51-generic

Release files / flake8_file_encoding-0.1.0-py3-none-any.whl

Download URL flake8_file_encoding-0.1.0-py3-none-any.whl
Size 3.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9106c9cc50c200ffc52621325f9463ebac6ee7320fcd3e954c9009e0bd92bcd0
BLAKE2b-256 checksum
How to use checksums
ccfc19f814ce3d20878d7b951c732d9d0a379a1cea24a87a76ca713909192821
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/0.12.16 CPython/3.7.3 Linux/4.15.0-51-generic

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page