|
From: John H. <jd...@gm...> - 2007-12-16 19:47:29
|
On Dec 16, 2007 1:33 PM, Andrew Straw <str...@as...> wrote:
> OK, I added unit/mlab_unit.py to svn. This checks that double precision
> floats can round-trip through rec2csv and csv2rec. To pass requires not
> only svn matplotlib (due to John's change), but also svn numpy (to be
> included with 1.0.5).
>
> Also, it doesn't seem to me that rec2csv should close a file handle
> passed to it. This prevents use with StringIO, for example. So, I added
> a test for that, too. John, if it's not going to break anything for you,
> I'll go ahead and fix that.
Yes, please do. You might want to modify cbook.to_filehandle to
optionally return a tuple specifying whether the returned fh is owned
by the caller. Something like:
fh, owner = cbook.to_filehandle(fname, returnowner=True)
and then later
if owner:
fh.close()
JDH
|