Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e79be87

Browse files
Issue #18743: Fix references to non-existant "StringIO" module.
1 parent ec34ab5 commit e79be87

6 files changed

Lines changed: 8 additions & 8 deletions

File tree

Doc/c-api/typeobj.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ type objects) *must* have the :attr:`ob_size` field.
192192
An optional pointer to the instance print function.
193193

194194
The print function is only called when the instance is printed to a *real* file;
195-
when it is printed to a pseudo-file (like a :class:`StringIO` instance), the
195+
when it is printed to a pseudo-file (like a :class:`io.StringIO` instance), the
196196
instance's :c:member:`~PyTypeObject.tp_repr` or :c:member:`~PyTypeObject.tp_str` function is called to convert it to
197197
a string. These are also called when the type's :c:member:`~PyTypeObject.tp_print` field is
198198
*NULL*. A type should never implement :c:member:`~PyTypeObject.tp_print` in a way that produces

Doc/library/gzip.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ The module defines the following items:
6262
value.
6363

6464
The new class instance is based on *fileobj*, which can be a regular file, a
65-
:class:`StringIO` object, or any other object which simulates a file. It
65+
:class:`io.BytesIO` object, or any other object which simulates a file. It
6666
defaults to ``None``, in which case *filename* is opened to provide a file
6767
object.
6868

Doc/library/mailbox.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,8 +674,8 @@ Supported mailbox formats are Maildir, mbox, MH, Babyl, and MMDF.
674674

675675
In Babyl mailboxes, the headers of a message are not stored contiguously
676676
with the body of the message. To generate a file-like representation, the
677-
headers and body are copied together into a :class:`StringIO` instance
678-
(from the :mod:`StringIO` module), which has an API identical to that of a
677+
headers and body are copied together into a :class:`io.BytesIO` instance,
678+
which has an API identical to that of a
679679
file. As a result, the file-like object is truly independent of the
680680
underlying mailbox but does not save memory compared to a string
681681
representation.

Doc/library/tempfile.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ The module defines the following user-callable items:
8282
causes the file to roll over to an on-disk file regardless of its size.
8383

8484
The returned object is a file-like object whose :attr:`_file` attribute
85-
is either a :class:`BytesIO` or :class:`StringIO` object (depending on
85+
is either a :class:`io.BytesIO` or :class:`io.StringIO` object (depending on
8686
whether binary or text *mode* was specified) or a true file
8787
object, depending on whether :func:`rollover` has been called. This
8888
file-like object can be used in a :keyword:`with` statement, just like

Doc/library/unittest.mock.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,9 +1084,9 @@ you wanted a :class:`NonCallableMock` to be used:
10841084
...
10851085
TypeError: 'NonCallableMock' object is not callable
10861086

1087-
Another use case might be to replace an object with a `StringIO` instance:
1087+
Another use case might be to replace an object with a `io.StringIO` instance:
10881088

1089-
>>> from StringIO import StringIO
1089+
>>> from io import StringIO
10901090
>>> def foo():
10911091
... print 'Something'
10921092
...

Doc/library/xml.dom.minidom.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ instead:
5555
.. function:: parseString(string, parser=None)
5656

5757
Return a :class:`Document` that represents the *string*. This method creates a
58-
:class:`StringIO` object for the string and passes that on to :func:`parse`.
58+
:class:`io.StringIO` object for the string and passes that on to :func:`parse`.
5959

6060
Both functions return a :class:`Document` object representing the content of the
6161
document.

0 commit comments

Comments
 (0)