We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Load STL files into vispy
Hi there, I think  I found a bug in vispy/vispy/io/mesh.py  in col 42:
mesh = load_stl(fname)
when I try to import a  *.stl file by read_mesh(fname), an error occured like this: 
 File "D:\Python3.5\lib\site-packages\vispy\io\mesh.py", line 43, in read_mesh
    mesh = load_stl(fname)
  File "D:\Python3.5\lib\site-packages\vispy\io\stl.py", line 43, in load_stl
    file_pos = file_obj.tell()
AttributeError: 'str' object has no attribute 'tell'
by change col42 into :mesh = trimesh.load(fname), problem soved!


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `vispy/io/mesh.py`
Content:
```
1 # -*- coding: utf-8 -*-
2 # Copyright (c) Vispy Development Team. All Rights Reserved.
3 # Distributed under the (new) BSD License. See LICENSE.txt for more info.
4 
5 """ Reading and writing of data like images and meshes.
6 """
7 
8 from os import path as op
9 
10 from .wavefront import WavefrontReader, WavefrontWriter
11 from .stl import load_stl
12 
13 
14 def read_mesh(fname):
15     """Read mesh data from file.
16 
17     Parameters
18     ----------
19     fname : str
20         File name to read. Format will be inferred from the filename.
21         Currently only '.obj' and '.obj.gz' are supported.
22 
23     Returns
24     -------
25     vertices : array
26         Vertices.
27     faces : array | None
28         Triangle face definitions.
29     normals : array
30         Normals for the mesh.
31     texcoords : array | None
32         Texture coordinates.
33     """
34     # Check format
35     fmt = op.splitext(fname)[1].lower()
36     if fmt == '.gz':
37         fmt = op.splitext(op.splitext(fname)[0])[1].lower()
38 
39     if fmt in ('.obj'):
40         return WavefrontReader.read(fname)
41     elif fmt in ('.stl'):
42         mesh = load_stl(fname)
43         vertices = mesh.vertices
44         faces = mesh.faces
45         normals = mesh.face_normals
46         texcoords = None
47         return vertices, faces, normals, texcoords
48     elif not format:
49         raise ValueError('read_mesh needs could not determine format.')
50     else:
51         raise ValueError('read_mesh does not understand format %s.' % fmt)
52 
53 
54 def write_mesh(fname, vertices, faces, normals, texcoords, name='',
55                format='obj', overwrite=False, reshape_faces=True):
56     """ Write mesh data to file.
57 
58     Parameters
59     ----------
60     fname : str
61         Filename to write. Must end with ".obj" or ".gz".
62     vertices : array
63         Vertices.
64     faces : array | None
65         Triangle face definitions.
66     normals : array
67         Normals for the mesh.
68     texcoords : array | None
69         Texture coordinates.
70     name : str
71         Name of the object.
72     format : str
73         Currently only "obj" is supported.
74     overwrite : bool
75         If the file exists, overwrite it.
76     reshape_faces : bool
77         Reshape the `faces` array to (Nf, 3). Set to `False`
78         if you need to write a mesh with non triangular faces.
79     """
80     # Check file
81     if op.isfile(fname) and not overwrite:
82         raise IOError('file "%s" exists, use overwrite=True' % fname)
83 
84     # Check format
85     if format not in ('obj'):
86         raise ValueError('Only "obj" format writing currently supported')
87     WavefrontWriter.write(fname, vertices, faces,
88                           normals, texcoords, name, reshape_faces)
89
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/vispy/io/mesh.py b/vispy/io/mesh.py
--- a/vispy/io/mesh.py
+++ b/vispy/io/mesh.py
@@ -39,10 +39,11 @@
     if fmt in ('.obj'):
         return WavefrontReader.read(fname)
     elif fmt in ('.stl'):
-        mesh = load_stl(fname)
-        vertices = mesh.vertices
-        faces = mesh.faces
-        normals = mesh.face_normals
+        file_obj = open(fname, mode='rb')
+        mesh = load_stl(file_obj)
+        vertices = mesh['vertices']
+        faces = mesh['faces']
+        normals = mesh['face_normals']
         texcoords = None
         return vertices, faces, normals, texcoords
     elif not format:

{"golden_diff": "diff --git a/vispy/io/mesh.py b/vispy/io/mesh.py\n--- a/vispy/io/mesh.py\n+++ b/vispy/io/mesh.py\n@@ -39,10 +39,11 @@\n     if fmt in ('.obj'):\n         return WavefrontReader.read(fname)\n     elif fmt in ('.stl'):\n-        mesh = load_stl(fname)\n-        vertices = mesh.vertices\n-        faces = mesh.faces\n-        normals = mesh.face_normals\n+        file_obj = open(fname, mode='rb')\n+        mesh = load_stl(file_obj)\n+        vertices = mesh['vertices']\n+        faces = mesh['faces']\n+        normals = mesh['face_normals']\n         texcoords = None\n         return vertices, faces, normals, texcoords\n     elif not format:\n", "issue": "Load STL files into vispy\nHi there, I think  I found a bug in vispy/vispy/io/mesh.py  in col 42:\r\nmesh = load_stl(fname)\r\nwhen I try to import a  *.stl file by read_mesh(fname), an error occured like this: \r\n File \"D:\\Python3.5\\lib\\site-packages\\vispy\\io\\mesh.py\", line 43, in read_mesh\r\n    mesh = load_stl(fname)\r\n  File \"D:\\Python3.5\\lib\\site-packages\\vispy\\io\\stl.py\", line 43, in load_stl\r\n    file_pos = file_obj.tell()\r\nAttributeError: 'str' object has no attribute 'tell'\r\nby change col42 into :mesh = trimesh.load(fname), problem soved!\r\n\n", "before_files": [{"content": "# -*- coding: utf-8 -*-\n# Copyright (c) Vispy Development Team. All Rights Reserved.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n\n\"\"\" Reading and writing of data like images and meshes.\n\"\"\"\n\nfrom os import path as op\n\nfrom .wavefront import WavefrontReader, WavefrontWriter\nfrom .stl import load_stl\n\n\ndef read_mesh(fname):\n    \"\"\"Read mesh data from file.\n\n    Parameters\n    ----------\n    fname : str\n        File name to read. Format will be inferred from the filename.\n        Currently only '.obj' and '.obj.gz' are supported.\n\n    Returns\n    -------\n    vertices : array\n        Vertices.\n    faces : array | None\n        Triangle face definitions.\n    normals : array\n        Normals for the mesh.\n    texcoords : array | None\n        Texture coordinates.\n    \"\"\"\n    # Check format\n    fmt = op.splitext(fname)[1].lower()\n    if fmt == '.gz':\n        fmt = op.splitext(op.splitext(fname)[0])[1].lower()\n\n    if fmt in ('.obj'):\n        return WavefrontReader.read(fname)\n    elif fmt in ('.stl'):\n        mesh = load_stl(fname)\n        vertices = mesh.vertices\n        faces = mesh.faces\n        normals = mesh.face_normals\n        texcoords = None\n        return vertices, faces, normals, texcoords\n    elif not format:\n        raise ValueError('read_mesh needs could not determine format.')\n    else:\n        raise ValueError('read_mesh does not understand format %s.' % fmt)\n\n\ndef write_mesh(fname, vertices, faces, normals, texcoords, name='',\n               format='obj', overwrite=False, reshape_faces=True):\n    \"\"\" Write mesh data to file.\n\n    Parameters\n    ----------\n    fname : str\n        Filename to write. Must end with \".obj\" or \".gz\".\n    vertices : array\n        Vertices.\n    faces : array | None\n        Triangle face definitions.\n    normals : array\n        Normals for the mesh.\n    texcoords : array | None\n        Texture coordinates.\n    name : str\n        Name of the object.\n    format : str\n        Currently only \"obj\" is supported.\n    overwrite : bool\n        If the file exists, overwrite it.\n    reshape_faces : bool\n        Reshape the `faces` array to (Nf, 3). Set to `False`\n        if you need to write a mesh with non triangular faces.\n    \"\"\"\n    # Check file\n    if op.isfile(fname) and not overwrite:\n        raise IOError('file \"%s\" exists, use overwrite=True' % fname)\n\n    # Check format\n    if format not in ('obj'):\n        raise ValueError('Only \"obj\" format writing currently supported')\n    WavefrontWriter.write(fname, vertices, faces,\n                          normals, texcoords, name, reshape_faces)\n", "path": "vispy/io/mesh.py"}], "after_files": [{"content": "# -*- coding: utf-8 -*-\n# Copyright (c) Vispy Development Team. All Rights Reserved.\n# Distributed under the (new) BSD License. See LICENSE.txt for more info.\n\n\"\"\" Reading and writing of data like images and meshes.\n\"\"\"\n\nfrom os import path as op\n\nfrom .wavefront import WavefrontReader, WavefrontWriter\nfrom .stl import load_stl\n\n\ndef read_mesh(fname):\n    \"\"\"Read mesh data from file.\n\n    Parameters\n    ----------\n    fname : str\n        File name to read. Format will be inferred from the filename.\n        Currently only '.obj' and '.obj.gz' are supported.\n\n    Returns\n    -------\n    vertices : array\n        Vertices.\n    faces : array | None\n        Triangle face definitions.\n    normals : array\n        Normals for the mesh.\n    texcoords : array | None\n        Texture coordinates.\n    \"\"\"\n    # Check format\n    fmt = op.splitext(fname)[1].lower()\n    if fmt == '.gz':\n        fmt = op.splitext(op.splitext(fname)[0])[1].lower()\n\n    if fmt in ('.obj'):\n        return WavefrontReader.read(fname)\n    elif fmt in ('.stl'):\n        file_obj = open(fname, mode='rb')\n        mesh = load_stl(file_obj)\n        vertices = mesh['vertices']\n        faces = mesh['faces']\n        normals = mesh['face_normals']\n        texcoords = None\n        return vertices, faces, normals, texcoords\n    elif not format:\n        raise ValueError('read_mesh needs could not determine format.')\n    else:\n        raise ValueError('read_mesh does not understand format %s.' % fmt)\n\n\ndef write_mesh(fname, vertices, faces, normals, texcoords, name='',\n               format='obj', overwrite=False, reshape_faces=True):\n    \"\"\" Write mesh data to file.\n\n    Parameters\n    ----------\n    fname : str\n        Filename to write. Must end with \".obj\" or \".gz\".\n    vertices : array\n        Vertices.\n    faces : array | None\n        Triangle face definitions.\n    normals : array\n        Normals for the mesh.\n    texcoords : array | None\n        Texture coordinates.\n    name : str\n        Name of the object.\n    format : str\n        Currently only \"obj\" is supported.\n    overwrite : bool\n        If the file exists, overwrite it.\n    reshape_faces : bool\n        Reshape the `faces` array to (Nf, 3). Set to `False`\n        if you need to write a mesh with non triangular faces.\n    \"\"\"\n    # Check file\n    if op.isfile(fname) and not overwrite:\n        raise IOError('file \"%s\" exists, use overwrite=True' % fname)\n\n    # Check format\n    if format not in ('obj'):\n        raise ValueError('Only \"obj\" format writing currently supported')\n    WavefrontWriter.write(fname, vertices, faces,\n                          normals, texcoords, name, reshape_faces)\n", "path": "vispy/io/mesh.py"}]}