Metadata-Version: 2.1
Name: flake8-file-encoding
Version: 0.1.0
Summary: A Flake8 plugin to check for files opened without an explicit encoding
Home-page: https://github.com/rayjolt/flake8-file-encoding
License: MIT
Keywords: flake8,file,open,encoding
Author: Jack Taylor
Author-email: rayjolt@gmail.com
Requires-Python: >=3.4,<4.0
Classifier: Environment :: Console
Classifier: Framework :: Flake8
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Software Development :: Quality Assurance
Requires-Dist: flake8 (>=3,<4)
Description-Content-Type: text/markdown

# 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](https://docs.python.org/3/library/functions.html#open) function, then
Python will use a platform-dependent default encoding—whatever
[locale.getpreferredencoding](https://docs.python.org/3/library/locale.html#locale.getpreferredencoding)
returns. On many platforms this is
[UTF-8](https://en.wikipedia.org/wiki/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](https://en.wikipedia.org/wiki/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

```bash
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](http://flake8.pycqa.org/en/latest/index.html).

## Errors

Code   | Message
------ | --------
FEN001 | open() call has no encoding argument

