Repository: holoviz/holoviews

Issue:
Error when trying to export plot using geoviews tiles with datashader
Adding `%%output fig='png' filename='eclipses'` to any of the nyc taxi notebooks (there are several versions of this and the one I'm specifically using is the one included in the scipy 2017 holoviews tutorial) results in the following exception for me


```
AttributeError                            Traceback (most recent call last)
~/miniconda3/lib/python3.6/site-packages/IPython/core/formatters.py in __call__(self, obj)
    330                 pass
    331             else:
--> 332                 return printer(obj)
    333             # Finally look for special method names
    334             method = get_real_method(obj, self.print_method)

~/miniconda3/lib/python3.6/site-packages/holoviews/ipython/display_hooks.py in pprint_display(obj)
    257     if not ip.display_formatter.formatters['text/plain'].pprint:
    258         return None
--> 259     return display(obj, raw=True)
    260 
    261 

~/miniconda3/lib/python3.6/site-packages/holoviews/ipython/display_hooks.py in display(obj, raw, **kwargs)
    243     elif isinstance(obj, (HoloMap, DynamicMap)):
    244         with option_state(obj):
--> 245             html = map_display(obj)
    246     else:
    247         return repr(obj) if raw else IPython.display.display(obj, **kwargs)

~/miniconda3/lib/python3.6/site-packages/holoviews/ipython/display_hooks.py in wrapped(element)
    129         try:
    130             html = fn(element,
--> 131                       max_frames=OutputSettings.options['max_frames'])
    132 
    133             # Only want to add to the archive for one display hook...

~/miniconda3/lib/python3.6/site-packages/holoviews/ipython/display_hooks.py in map_display(vmap, max_frames)
    198         return None
    199 
--> 200     return render(vmap)
    201 
    202 

~/miniconda3/lib/python3.6/site-packages/holoviews/ipython/display_hooks.py in render(obj, **kwargs)
     59     if renderer.fig == 'pdf':
     60         renderer = renderer.instance(fig='png')
---> 61     return renderer.html(obj, **kwargs)
     62 
     63 

~/miniconda3/lib/python3.6/site-packages/holoviews/plotting/renderer.py in html(self, obj, fmt, css, comm, **kwargs)
    277         if comm and plot.comm is not None:
    278             comm, msg_handler = self.comms[self.mode]
--> 279             msg_handler = msg_handler.format(comm_id=plot.comm.id)
    280             return comm.template.format(init_frame=html,
    281                                         msg_handler=msg_handler,

AttributeError: 'NoneType' object has no attribute 'format'

Out[13]:
:DynamicMap   [] 
```

Some version info for you
```
Python 3.6.1 | packaged by conda-forge | (default, May 23 2017, 14:31:56) 
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import holoviews
>>> holoviews.__version__
1.8.1
>>> import bokeh
>>> bokeh.__version__
'0.12.6'
>>> import geoviews
>>> geoviews.__version__
1.3.0
>>> import datashader
/Users/shughes/miniconda3/lib/python3.6/site-packages/odo/backends/pandas.py:94: FutureWarning: pandas.tslib is deprecated and will be removed in a future version.
You can access NaTType as type(pandas.NaT)
  @convert.register((pd.Timestamp, pd.Timedelta), (pd.tslib.NaTType, type(None)))
>>> datashader.__version__
'0.5.0'

```


Discussion:
Thanks for reporting this. I believe this bug affects all dynamic output, but it should be an easy fix. Should get this into 1.8.2.

Resolving patch:
diff --git a/holoviews/plotting/renderer.py b/holoviews/plotting/renderer.py
--- a/holoviews/plotting/renderer.py
+++ b/holoviews/plotting/renderer.py
@@ -276,6 +276,8 @@ def html(self, obj, fmt=None, css=None, comm=True, **kwargs):
         html = tag.format(src=src, mime_type=mime_type, css=css)
         if comm and plot.comm is not None:
             comm, msg_handler = self.comms[self.mode]
+            if msg_handler is None:
+                return html
             msg_handler = msg_handler.format(comm_id=plot.comm.id)
             return comm.template.format(init_frame=html,
                                         msg_handler=msg_handler,


Test patch: