diff --git a/nglview/widget.py b/nglview/widget.py index 3edfc032..9e18de1f 100644 --- a/nglview/widget.py +++ b/nglview/widget.py @@ -1245,8 +1245,8 @@ def _load_data(self, obj, **kwargs): ext=kwargs.get('ext'), compressed=kwargs.get('compressed')) # assume passing string - blob = fh.read() - passing_buffer = not fh.use_filename + blob = fh.read(force_buffer=True) + passing_buffer = True if fh.ext is None and passing_buffer: raise ValueError('must provide extension')