I found the difference from StringIO and BytesIO(But I have no idea why):
First check this (python 2.7/3.3):
Python 2.7.2 (default, Jun 20 2012, 16:23:33)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from io import BytesIO,StringIO
>>> print(BytesIO(b'hello\n'*10).readlines(6))
['hello\n']
>>> print(StringIO(u'hello\n'*10).readlines(6))
[u'hello\n', u'hello\n']
>>>
The C source codes from StringIO and BytesIO link here:
620 while (1) {
621 PyObject *line = PyIter_Next(self);
622 if (line == NULL) {
623 if (PyErr_Occurred()) {
624 Py_DECREF(result);
625 return NULL;
626 }
627 else
628 break; /* StopIteration raised */
629 }
630
631 if (PyList_Append(result, line) < 0) {
632 Py_DECREF(line);
633 Py_DECREF(result);
634 return NULL;
635 }
636 length += PyObject_Size(line);
637 Py_DECREF(line);
638
639 if (length > hint)
640 break;
641 }
413 while ((n = get_line(self, &output)) != 0) {
414 line = PyBytes_FromStringAndSize(output, n);
415 if (!line)
416 goto on_error;
417 if (PyList_Append(result, line) == -1) {
418 Py_DECREF(line);
419 goto on_error;
420 }
421 Py_DECREF(line);
422 size += n;
423 if (maxsize > 0 && size >= maxsize)
424 break;
425 }
426 return result;