ipython/ipython — Issue #1156: Notebooks downloaded as Python files require a header stating the encoding
Author: Midnighter
Created: 2011-12-15 15:15:17+00:00
State: open

The following problem occurred: I have a notebook with a mardown cell that contains non-ASCII characters. When I try to run the file I get the following error:

SyntaxError: Non-ASCII character '\xc3' in file bla.py on line 11, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details

even though the offending character is commented.

Putting something like `# -*- coding: utf-8 -*-` in the first or second line of the file solves the problem, I think this should be standard procedure for exporting the notebook.