A Flake8 plugin to identify incorrect use of encodings.
Project description
A Flake8 plugin to identify incorrect use of encodings.
Docs |
|
---|---|
Tests |
|
PyPI |
|
Anaconda |
|
Activity |
|
QA |
|
Other |
Installation
flake8-encodings can be installed from PyPI or Anaconda.
To install with pip:
$ python -m pip install flake8-encodings
To install with conda:
First add the required channels
$ conda config --add channels https://conda.anaconda.org/conda-forge $ conda config --add channels https://conda.anaconda.org/domdfcoding
Then install
$ conda install flake8-encodings
Motivation
Developers using macOS or Linux may forget that the default encoding is not always UTF-8.
For example, long_description = open("README.md").read() in setup.py is a common mistake. Many Windows users cannot install the package if there is at least one non-ASCII character (e.g. emoji) in the README.md file which is encoded in UTF-8.
For example, 489 packages of the 4000 most downloaded packages from PyPI used non-ASCII characters in README. And 82 packages of them cannot be installed from source package when the locale encoding is ASCII. [1] They used the default encoding to read README or TOML file.
Even Python experts assume that default encoding is UTF-8. It creates bugs that happen only on Windows. See [2], [3], [4], and [5] for example.
PEP 597 proposed adding a new EncodingWarning to Python, which can be used in conjunction with this tool to identify issues at runtime.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file flake8_encodings-0.3.5.tar.gz
.
File metadata
- Download URL: flake8_encodings-0.3.5.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e394db259db6fa78bce302b781f7df8a1bc94573939e7fa1b15a634fd94d19f2 |
|
MD5 | a2236dea22b9196e4ebc46a3f428b4e2 |
|
BLAKE2b-256 | 8d32683397a2c74aa2b2e9725b9e1c59527511633be4d58a2f88fba42674a267 |
File details
Details for the file flake8_encodings-0.3.5-py3-none-any.whl
.
File metadata
- Download URL: flake8_encodings-0.3.5-py3-none-any.whl
- Upload date:
- Size: 22.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f208b29cffa1850d1c9c757c55ec9afbce38d12dcfa0117589b3b788e669502a |
|
MD5 | 922e59273bb4929d0586a35110487f21 |
|
BLAKE2b-256 | 3a19c65d6e11a037de52fadcd9360e1824d0132ff19918f7b41d0531fbd7b676 |