From: Frank W. <fwi...@gm...> - 2009-08-17 00:23:29
|
Philip, Thanks for the improvements! -Frank On Sun, Aug 16, 2009 at 6:40 PM, <pj...@us...> wrote: > Revision: 6683 > http://jython.svn.sourceforge.net/jython/?rev=6683&view=rev > Author: pjenvey > Date: 2009-08-16 22:40:47 +0000 (Sun, 16 Aug 2009) > > Log Message: > ----------- > restrict array writes to binary mode > > Modified Paths: > -------------- > trunk/jython/src/org/python/core/PyFile.java > > Modified: trunk/jython/src/org/python/core/PyFile.java > =================================================================== > --- trunk/jython/src/org/python/core/PyFile.java 2009-08-16 22:25:58 UTC (rev 6682) > +++ trunk/jython/src/org/python/core/PyFile.java 2009-08-16 22:40:47 UTC (rev 6683) > @@ -354,12 +354,12 @@ > file_write(o.__str__().string); > } else if (o instanceof PyString) { > file_write(((PyString)o).string); > - } else if (o instanceof PyArray) { > - ((PyArray)o).tofile(this); > + } else if (binary && o instanceof PyArray) { > + file_write(((PyArray)o).tostring()); > } else { > - //XXX: Match CPython's error message better > - // "argument 1 must be string or read-only buffer, not {type}" > - throw Py.TypeError("write requires a string or read-only buffer as its argument"); > + throw Py.TypeError(String.format("argument 1 must be string or %sbuffer, not %.200s", > + binary ? "" : "read-only character ", > + o.getType().fastGetName())); > } > } > > > > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Jython-checkins mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-checkins > |