Discussion:
[Bitpim-devel] Re: [bitpim-cvs-checkins] bitpim guiwidgets.py,1.204,1.205
Roger Binns
2004-10-20 05:00:35 UTC
Permalink
cStringIO was still used in OnSave. Changed to StringIO.
import cStringIO would also have solved the problem :-)

For those that don't know, StringIO lets you treat a chunk
of memory as though it is a file. It was used in this case
to build up html, which is then displayed or saved to file.
StringIO is implemented in pure Python and hence can be a
little slow. cStringIO is pure C code and a lot faster
and hence preferable. But the gotcha is that cStringIO can
only handle ascii/8 bit characters whereas StringIO quite
happily deals with that as well as Unicode.

That is why there were a bunch of cStringIO changed to StringIO
during the wxPython 2.5 migration as we also moved to unicode
under the hood.

Roger

Loading...