]> granicus.if.org Git - python/commitdiff
Remove last traces of cStringIO.
authorGeorg Brandl <georg@python.org>
Tue, 10 Jun 2008 15:50:56 +0000 (15:50 +0000)
committerGeorg Brandl <georg@python.org>
Tue, 10 Jun 2008 15:50:56 +0000 (15:50 +0000)
13 files changed:
Doc/library/csv.rst
Doc/library/email.message.rst
Doc/library/pickle.rst
Include/cStringIO.h [deleted file]
Lib/test/test_sys.py
Modules/Setup.dist
PC/VS8.0/pythoncore.vcproj
PC/os2emx/config.c
PC/os2emx/python26.def
PC/os2vacpp/config.c
PC/os2vacpp/makefile
PC/os2vacpp/makefile.omk
PCbuild/pythoncore.vcproj

index 6beadc5791c801f9c37998b6e5d348f9abf6bb9e..9043dbc4538e0576231c7571acdafc92a2942779 100644 (file)
@@ -484,7 +484,7 @@ For all other encodings the following :class:`UnicodeReader` and
 parameter in their constructor and make sure that the data passes the real
 reader or writer encoded as UTF-8::
 
-   import csv, codecs, cStringIO
+   import csv, codecs, io
 
    class UTF8Recoder:
        """
@@ -524,7 +524,7 @@ reader or writer encoded as UTF-8::
 
        def __init__(self, f, dialect=csv.excel, encoding="utf-8", **kwds):
            # Redirect output to a queue
-           self.queue = cStringIO.StringIO()
+           self.queue = io.StringIO()
            self.writer = csv.writer(self.queue, dialect=dialect, **kwds)
            self.stream = f
            self.encoder = codecs.getincrementalencoder(encoding)()
index 5344b454c38335f3baf00fbced61dbe4b350bf21..f51230c3733073d84eb61522eb0d5e0b093488f6 100644 (file)
@@ -48,7 +48,7 @@ Here are the methods of the :class:`Message` class:
       :class:`Generator` instance and use its :meth:`flatten` method directly.
       For example::
 
-         from cStringIO import StringIO
+         from io import StringIO
          from email.generator import Generator
          fp = StringIO()
          g = Generator(fp, mangle_from_=False, maxheaderlen=60)
index 21945238d6af5fcd464aeb35238561197e7fd013..76248ac66be4ba4338a4944929af03d57dbd7a06 100644 (file)
@@ -555,7 +555,7 @@ the referenced object.
 Here's a silly example that *might* shed more light::
 
    import pickle
-   from cStringIO import StringIO
+   from io import StringIO
 
    src = StringIO()
    p = pickle.Pickler(src)
diff --git a/Include/cStringIO.h b/Include/cStringIO.h
deleted file mode 100644 (file)
index d22b9eb..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-#ifndef Py_CSTRINGIO_H
-#define Py_CSTRINGIO_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
-
-  This header provides access to cStringIO objects from C.
-  Functions are provided for calling cStringIO objects and
-  macros are provided for testing whether you have cStringIO 
-  objects.
-
-  Before calling any of the functions or macros, you must initialize
-  the routines with:
-
-    PycString_IMPORT
-
-  This would typically be done in your init function.
-
-*/
-#define PycString_IMPORT \
-  PycStringIO = (struct PycStringIO_CAPI*)PyCObject_Import("cStringIO", \
-                                                           "cStringIO_CAPI")
-
-/* Basic functions to manipulate cStringIO objects from C */
-
-static struct PycStringIO_CAPI {
-  
- /* Read a string from an input object.  If the last argument
-    is -1, the remainder will be read.
-    */
-  int(*cread)(PyObject *, char **, Py_ssize_t);
-
- /* Read a line from an input object.  Returns the length of the read
-    line as an int and a pointer inside the object buffer as char** (so
-    the caller doesn't have to provide its own buffer as destination).
-    */
-  int(*creadline)(PyObject *, char **);
-
-  /* Write a string to an output object*/
-  int(*cwrite)(PyObject *, const char *, Py_ssize_t);
-
-  /* Get the output object as a Python string (returns new reference). */
-  PyObject *(*cgetvalue)(PyObject *);
-
-  /* Create a new output object */
-  PyObject *(*NewOutput)(int);
-
-  /* Create an input object from a Python string
-     (copies the Python string reference).
-     */
-  PyObject *(*NewInput)(PyObject *);
-
-  /* The Python types for cStringIO input and output objects.
-     Note that you can do input on an output object.
-     */
-  PyTypeObject *InputType, *OutputType;
-
-} *PycStringIO;
-
-/* These can be used to test if you have one */
-#define PycStringIO_InputCheck(O) \
-  (Py_TYPE(O)==PycStringIO->InputType)
-#define PycStringIO_OutputCheck(O) \
-  (Py_TYPE(O)==PycStringIO->OutputType)
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* !Py_CSTRINGIO_H */
index 14f55fbbd1d8ad32c80d071c41b4190f6351d570..e9570e902650c89cc440df5811be7ab0ed8fd6bb 100644 (file)
@@ -297,7 +297,7 @@ class SysModuleTest(unittest.TestCase):
         self.assert_(isinstance(vi[4], int))
 
     def test_43581(self):
-        # Can't use sys.stdout, as this is a cStringIO object when
+        # Can't use sys.stdout, as this is a StringIO object when
         # the test runs under regrtest.
         self.assertEqual(sys.__stdout__.encoding, sys.__stderr__.encoding)
 
index 88c85b517bdb2b6f65631a76202f98d9be6ad67c..a790556aa0559c8dd6d3a8fbc638d4b5c5a12a5f 100644 (file)
@@ -339,9 +339,6 @@ _symtable symtablemodule.c
 # Fred Drake's interface to the Python parser
 #parser parsermodule.c
 
-# cStringIO
-#cStringIO cStringIO.c
-
 
 # Lee Busby's SIGFPE modules.
 # The library to link fpectl with is platform specific.
index 2d34d12485cf033bcf09c5e0b879065cacbdd1e3..b8c0ffe9ee328359ca0b667ecdbe1831d6bceb00 100644 (file)
                                RelativePath="..\..\Include\complexobject.h"\r
                                >\r
                        </File>\r
-                       <File\r
-                               RelativePath="..\..\Include\cStringIO.h"\r
-                               >\r
-                       </File>\r
                        <File\r
                                RelativePath="..\..\Include\datetime.h"\r
                                >\r
index 93fbeccd99bfa0d771038729903897c316d1de34..88ece9da6d19f773b45e47b484ecc2579a815a48 100644 (file)
@@ -50,7 +50,6 @@ extern void init_symtable();
 extern void init_weakref();
 extern void initarray();
 extern void initbinascii();
-extern void initcStringIO();
 extern void initcollections();
 extern void initcmath();
 extern void initdatetime();
@@ -110,7 +109,6 @@ struct _inittab _PyImport_Inittab[] = {
        {"_weakref", init_weakref},
        {"array", initarray},
        {"binascii", initbinascii},
-       {"cStringIO", initcStringIO},
        {"collections", initcollections},
        {"cmath", initcmath},
        {"datetime", initdatetime},
index 3cdb44a1b7da8f74acfab70b2beebb51b9d1799a..46c548e868855566e284d46fc0e5aa856085cd88 100644 (file)
@@ -1218,9 +1218,6 @@ EXPORTS
 ;  "initcPickle"
 ;  "fast_save_leave"
 
-; From python26_s.lib(cStringIO)
-;  "initcStringIO"
-
 ; From python26_s.lib(_csv)
 ;  "init_csv"
 
index aba6e7909810569f549c75d5b6725a5d7a617dc8..bbdf6f3cd8e39b08cfbe1c3b312e0437e3b76581 100644 (file)
@@ -34,7 +34,6 @@ extern void init_socket(void);
 extern void initstruct(void);
 extern void inittime(void);
 extern void init_thread(void);
-extern void initcStringIO(void);
 extern void initpcre(void);
 #ifdef WIN32
 extern void initmsvcrt(void);
@@ -78,7 +77,6 @@ struct _inittab _PyImport_Inittab[] = {
 #ifdef WITH_THREAD
         {"_thread", init_thread},
 #endif
-        {"cStringIO", initcStringIO},
         {"pcre", initpcre},
 #ifdef WIN32
         {"msvcrt", initmsvcrt},
index 55bb7838e47da2140dcaa08a26efb287bcc1a7ca..d47ff1f75a9f6d8bab46a083da68baba1d00d62e 100644 (file)
@@ -180,7 +180,6 @@ MODULES             =                              \
                   $(PATHOBJ)\ArrayModule.obj   \
                   $(PATHOBJ)\BinAscii.obj      \
                   $(PATHOBJ)\CMathModule.obj   \
-                  $(PATHOBJ)\cStringIO.obj     \
                   $(PATHOBJ)\ErrnoModule.obj   \
                   $(PATHOBJ)\GCModule.obj      \
                   $(PATHOBJ)\GetBuildInfo.obj  \
@@ -440,7 +439,7 @@ cmathmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
 
 cpickle.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
         $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-        $(PY_INCLUDE)\cstringio.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
+        $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
         $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
         $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
         $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
@@ -466,20 +465,6 @@ cryptmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
         $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
         $(PY_INCLUDE)\tupleobject.h
 
-cstringio.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
-        $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
-        $(PY_INCLUDE)\cstringio.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
-        $(PY_INCLUDE)\floatobject.h $(PY_INCLUDE)\funcobject.h $(PY_INCLUDE)\import.h \
-        $(PY_INCLUDE)\intobject.h $(PY_INCLUDE)\intrcheck.h $(PY_INCLUDE)\listobject.h \
-        $(PY_INCLUDE)\longobject.h $(PY_INCLUDE)\methodobject.h \
-        $(PY_INCLUDE)\modsupport.h $(PY_INCLUDE)\moduleobject.h $(PY_INCLUDE)\mymalloc.h \
-        $(PY_INCLUDE)\myproto.h $(PY_INCLUDE)\object.h $(PY_INCLUDE)\objimpl.h \
-        $(PY_INCLUDE)\pydebug.h $(PY_INCLUDE)\pyerrors.h $(PY_INCLUDE)\pyfpe.h \
-        $(PY_INCLUDE)\pystate.h $(PY_INCLUDE)\python.h $(PY_INCLUDE)\pythonrun.h \
-        $(PY_INCLUDE)\rangeobject.h $(PY_INCLUDE)\sliceobject.h \
-        $(PY_INCLUDE)\stringobject.h $(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h \
-        $(PY_INCLUDE)\tupleobject.h
-
 cursesmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h \
         $(PY_INCLUDE)\classobject.h $(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h \
         pyconfig.h $(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h \
index 7083c789d686a14199b6a913876d50ddcec4c856..4f7f478f4b63784cd2ce1dd59f9d799819e2e10b 100644 (file)
@@ -142,7 +142,6 @@ MODULES             =                   \
                   ArrayModule.obj   \
                   BinAscii.obj      \
                   CMathModule.obj   \
-                  cStringIO.obj     \
                   ErrnoModule.obj   \
                   GetBuildInfo.obj  \
                   GetPathP.obj      \
@@ -379,7 +378,7 @@ cmathmodule.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
         stringobject.h sysmodule.h traceback.h tupleobject.h
 
 cpickle.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-        pyconfig.h cstringio.h dictobject.h fileobject.h floatobject.h \
+        pyconfig.h dictobject.h fileobject.h floatobject.h \
         funcobject.h import.h intobject.h intrcheck.h listobject.h \
         longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
         mymath.h myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
@@ -394,14 +393,6 @@ cryptmodule.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
         pythonrun.h rangeobject.h sliceobject.h stringobject.h sysmodule.h \
         traceback.h tupleobject.h
 
-cstringio.obj: abstract.h ceval.h classobject.h cobject.h complexobject.h \
-        pyconfig.h cstringio.h dictobject.h fileobject.h floatobject.h \
-        funcobject.h import.h intobject.h intrcheck.h listobject.h \
-        longobject.h methodobject.h modsupport.h moduleobject.h mymalloc.h \
-        myproto.h object.h objimpl.h pydebug.h pyerrors.h pyfpe.h \
-        pystate.h python.h pythonrun.h rangeobject.h sliceobject.h \
-        stringobject.h sysmodule.h traceback.h tupleobject.h
-
 cursesmodule.obj: abstract.h ceval.h classobject.h cobject.h \
         complexobject.h pyconfig.h dictobject.h fileobject.h floatobject.h \
         funcobject.h import.h intobject.h intrcheck.h listobject.h \
index d8771159d0ee4122d72b139501fb3cc3888da0ff..ca33a97432680da384ec1a4550e528f0adae0fde 100644 (file)
                                RelativePath="..\Include\complexobject.h"
                                >
                        </File>
-                       <File
-                               RelativePath="..\Include\cStringIO.h"
-                               >
-                       </File>
                        <File
                                RelativePath="..\Include\datetime.h"
                                >