Skip to content

Commit

Permalink
[2.7] bpo-13525: Fix incorrect encoding name in the tutorial example. (
Browse files Browse the repository at this point in the history
…pythonGH-6738).

(cherry picked from commit ddb6215)

Co-authored-by: Serhiy Storchaka <[email protected]>
  • Loading branch information
serhiy-storchaka committed May 9, 2018
1 parent 903f189 commit 2321730
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Doc/tutorial/interpreter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,12 @@ where *encoding* is one of the valid :mod:`codecs` supported by Python.
For example, to declare that Windows-1252 encoding is to be used, the first
line of your source code file should be::

# -*- coding: cp-1252 -*-
# -*- coding: cp1252 -*-

One exception to the *first line* rule is when the source code starts with a
:ref:`UNIX "shebang" line <tut-scripts>`. In this case, the encoding
declaration should be added as the second line of the file. For example::

#!/usr/bin/env python
# -*- coding: cp-1252 -*-
# -*- coding: cp1252 -*-

0 comments on commit 2321730

Please sign in to comment.