.. _non-ascii-file-name:

non-ascii-file-name / W2402
===========================

**Message emitted:**

%s name "%s" contains a non-ASCII character. PEP 3131 only allows non-ascii identifiers, not file names.

**Description:**

*Some editors don't support non-ASCII file names properly. Even though Python supports UTF-8 files since Python 3.5 this isn't recommended for interoperability. Further reading:
- https://peps.python.org/pep-0489/#export-hook-name
- https://peps.python.org/pep-0672/#confusing-features
- https://bugs.python.org/issue20485*


**Correct code:**

.. literalinclude:: /data/messages/n/non-ascii-file-name/good.py
   :language: python

**Additional details:**

You can help us make the doc better `by contributing <https://github.com/PyCQA/pylint/issues/5953>`_ !


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