matplotlib/matplotlib — pull request #2498 by megies (2013-10-06 11:35:19+00:00)
Title: savefig() with StringIO.StringIO() object failing for PS backend on Python 2.7.5

`savefig(..., format="ps")` is raising when passing on a `StringIO.StringIO` object.
This PR adds a minimal test case to demonstrate the issue. The issue was caused by the change in https://github.com/matplotlib/matplotlib/commit/f4adec7b#diff-b465967f537465fec4960b152fa49cffL1110 (Py3 compatibility concerned, only present in `master`).

Here is the exception (I have checked, `raw_fh` is of type `StringIO.StringIO`):
```
File "matplotlib/lib/matplotlib/backends/backend_ps.py", line 1108, in print_figure_impl
fh = io.TextIOWrapper(raw_fh, encoding="ascii")
AttributeError: readable
```

A simple fix would be to revert those 4 lines, I guess, but I assume this might get handled differently, so I am not adding a fix for now.