From 9ea16f28a7667c7a7de27279164ecc68746f1751 2014-10-08 19:33:34 From: MinRK Date: 2014-10-08 19:33:34 Subject: [PATCH] fill missing metadata when upgrading v2->v3 --- diff --git a/IPython/nbformat/v3/convert.py b/IPython/nbformat/v3/convert.py index 65e54ee..c2857bb 100644 --- a/IPython/nbformat/v3/convert.py +++ b/IPython/nbformat/v3/convert.py @@ -45,6 +45,9 @@ def upgrade(nb, from_version=2, from_minor=0): nb.orig_nbformat = 2 nb = _unbytes(nb) + for ws in nb['worksheets']: + for cell in ws['cells']: + cell.setdefault('metadata', {}) return nb elif from_version == 3: if from_minor != nbformat_minor: