diff --git a/IPython/nbformat/v2/nbpy.py b/IPython/nbformat/v2/nbpy.py
index e32c642..243bc65 100644
--- a/IPython/nbformat/v2/nbpy.py
+++ b/IPython/nbformat/v2/nbpy.py
@@ -113,8 +113,8 @@ class PyReader(NotebookReader):
class PyWriter(NotebookWriter):
def writes(self, nb, **kwargs):
- lines = []
- lines.extend([u'# coding: utf-8', u'# 2',''])
+ lines = [u'# coding: utf-8']
+ lines.extend([u'# 2',''])
for ws in nb.worksheets:
for cell in ws.cells:
if cell.cell_type == u'code':