Skip to main content

A Flake8 plugin to identify incorrect use of encodings.

Project description

A Flake8 plugin to identify incorrect use of encodings.

Docs

Documentation Build Status Docs Check Status

Tests

Linux Test Status Windows Test Status macOS Test Status Coverage

PyPI

PyPI - Package Version PyPI - Supported Python Versions PyPI - Supported Implementations PyPI - Wheel

Anaconda

Conda - Package Version Conda - Platform

Activity

GitHub last commit GitHub commits since tagged version Maintenance PyPI - Downloads

QA

CodeFactor Grade Flake8 Status mypy status pre-commit.ci status

Other

License GitHub top language Requirements Status

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 http://conda.anaconda.org/conda-forge
$ conda config --add channels http://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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flake8_encodings-0.2.2.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

flake8_encodings-0.2.2-py3-none-any.whl (18.9 kB view details)

Uploaded Python 3

File details

Details for the file flake8_encodings-0.2.2.tar.gz.

File metadata

  • Download URL: flake8_encodings-0.2.2.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for flake8_encodings-0.2.2.tar.gz
Algorithm Hash digest
SHA256 c719ff155abc88e8ad84e892d14c6ee192df0c046cf9a06088688b0a1934308d
MD5 699ad57bd54ad000a92c8dcdfaa4044d
BLAKE2b-256 f9ac6b88f89bc7115c66d93cb22a03d3cc61202d538ea7a37fb7a8a99d71d613

See more details on using hashes here.

File details

Details for the file flake8_encodings-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: flake8_encodings-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 18.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.2

File hashes

Hashes for flake8_encodings-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1776d8d53de6723158623f6d9cee5efae31b1366b607627e2cdbb6abd6ac7f74
MD5 61d2aac36494fef61cb991194097f68f
BLAKE2b-256 d9997dd9bb83a37cf0c4c33eb93b69f7305fd986c26a77dfd49d475d27bcd9e5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page