matplotlib/matplotlib — Issue #620: savefig crash on .eps filename
Author: Carreau
Created: 2011-12-12 17:04:51+00:00
State: open

savefig crash on .eps filename,

Complainig that `StrinIO` does not exist here :
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/backends/backend_ps.py#L1201

```python
if dryrun:
class NullWriter(object):
def write(self, *kl, **kwargs):
pass

self._pswriter = NullWriter()
else:
self._pswriter = StringIO() #here
```

maybe should be replaced by something like that found a few (150) line above...
https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/backends/backend_ps.py#L1045

```Python
if dryrun:
class NullWriter(object):
def write(self, *kl, **kwargs):
pass

self._pswriter = NullWriter()
else:
if sys.version_info[0] >= 3:
self._pswriter = io.StringIO()
else:
self._pswriter = cStringIO.StringIO()
```
or change the import on the top to `import` either `cStingIO.StringIO` or `io.StringIO` `as StrinIO` but as I don't know the internal I prefer to leave the pro doing something.

crashing example:

```python
matplotlib.rcParams['text.usetex']=True
plot(range(10))
savefig('test.eps')
```

Hopping I'm not doing anything wrong on my side...
Thank you for the great work, I appreciate matplotlib more and more every day