.. _unspecified-encoding:

unspecified-encoding / W1514
============================

**Message emitted:**

Using open without explicitly specifying an encoding

**Description:**

*It is better to specify an encoding when opening documents. Using the system default implicitly can create problems on other operating systems. See https://peps.python.org/pep-0597/*

**Problematic code:**

.. literalinclude:: /data/messages/u/unspecified-encoding/bad.py
   :language: python

**Correct code:**

.. literalinclude:: /data/messages/u/unspecified-encoding/good.py
   :language: python



Created by the `stdlib <https://github.com/PyCQA/pylint/blob/main/pylint/checkers/stdlib.py>`__ checker.