diff -r c9bd3298669d -r 5554cdeb2854 Lib/test/test_StringIO.py --- a/Lib/test/test_StringIO.py Thu Mar 21 18:34:45 2013 -0700 +++ b/Lib/test/test_StringIO.py Thu Mar 21 22:09:16 2013 -0700 @@ -128,7 +128,6 @@ class TestcStringIO(TestGenericStringIO): MODULE = cStringIO - @unittest.skipIf(test_support.is_jython, "FIXME #1862: not working in Jython") def test_array_support(self): # Issue #1730114: cStringIO should accept array objects a = array.array('B', [0,1,2]) diff -r c9bd3298669d -r 5554cdeb2854 src/org/python/modules/cStringIO.java --- a/src/org/python/modules/cStringIO.java Thu Mar 21 18:34:45 2013 -0700 +++ b/src/org/python/modules/cStringIO.java Thu Mar 21 22:09:16 2013 -0700 @@ -12,6 +12,7 @@ package org.python.modules; import org.python.core.Py; +import org.python.core.PyArray; import org.python.core.PyIterator; import org.python.core.PyList; import org.python.core.PyObject; @@ -51,6 +52,15 @@ return new StringIO(buffer); } + /** + * Create a StringIO object, initialized by an array's byte stream. + * @param array The initial value, from an array. + * @return a new StringIO object. + */ + public static StringIO StringIO(PyArray array) { + return new StringIO(array); + } + /** * The StringIO object @@ -73,6 +83,10 @@ buf = new StringBuilder(buffer); } + public StringIO(PyArray array) { + buf = new StringBuilder(array.tostring()); + } + private void _complain_ifclosed() { if (closed) throw Py.ValueError("I/O operation on closed file");