Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue2918] Merge StringIO/cStringIO in 3.0

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

May 19, 2008, 1:01 PM

Post #1 of 6 (358 views)
Permalink
[issue2918] Merge StringIO/cStringIO in 3.0

New submission from Brett Cannon <brett [at] python>:

PEP 3108 calls for StringIO (which is io.StringIO in 3.0) to have an
accelerated version behind it when available. Alexandre has been working
on this so assigning to him.

----------
assignee: alexandre.vassalotti
components: Library (Lib)
messages: 67072
nosy: alexandre.vassalotti, brett.cannon
priority: release blocker
severity: normal
status: open
title: Merge StringIO/cStringIO in 3.0
type: behavior
versions: Python 3.0

__________________________________
Tracker <report [at] bugs>
<http://bugs.python.org/issue2918>
__________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

May 29, 2008, 3:35 PM

Post #2 of 6 (340 views)
Permalink
[issue2918] Merge StringIO/cStringIO in 3.0 [In reply to]

Changes by Humberto Diogenes <humberto [at] digi>:


----------
nosy: +hdiogenes

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue2918>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 9, 2008, 7:14 PM

Post #3 of 6 (327 views)
Permalink
[issue2918] Merge StringIO/cStringIO in 3.0 [In reply to]

Alexandre Vassalotti <alexandre [at] peadrop> added the comment:

Here's a preliminary patch that add the C optimization for StringIO.
All tests are passing except two which depends on the StringIO.buffer
attribute of the TextIOWrapper class. Honestly, I am not sure what is
the correct way to fix this. I cannot simply "fake" the attribute by
returning a BytesIO object, since the file position of buffer is
undecidable. It seems to me that the only way to fix these failing tests
would be to define a FakeIO class, in their test file, that would wrap
ByteIO with TextIOWrapper, just like the old and inefficient StringIO.

So, any idea on what would be the best thing to do?

----------
keywords: +patch
Added file: http://bugs.python.org/file10568/add-stringio-1.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue2918>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 10, 2008, 9:22 PM

Post #4 of 6 (323 views)
Permalink
[issue2918] Merge StringIO/cStringIO in 3.0 [In reply to]

Alexandre Vassalotti <alexandre [at] peadrop> added the comment:

Here's another patch fixes the failing tests. I have tried to support
the buffer attribute using following hack:

@property
def buffer(self):
# XXX Hack to support the buffer attribute.
buf = codecs.getwriter(self.encoding)(BytesIO(), self.errors)
value = self.getvalue()
buf.write(value[:self.tell()])
pos = buf.stream.tell()
buf.write(value[self.tell():])
buf.stream.seek(pos)
return buf.stream

but this doesn't work since some application might want to modify the
buffer. So, I removed it. Another thing that bothered me were the bogus
encoding and errors arguments. So, I also removed them.

Added file: http://bugs.python.org/file10577/add-stringio-2.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue2918>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 11, 2008, 3:03 PM

Post #5 of 6 (317 views)
Permalink
[issue2918] Merge StringIO/cStringIO in 3.0 [In reply to]

Alexandre Vassalotti <alexandre [at] peadrop> added the comment:

I updated the patch to use the new module framework.

Added file: http://bugs.python.org/file10593/add-stringio-3.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue2918>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Jun 11, 2008, 4:05 PM

Post #6 of 6 (317 views)
Permalink
[issue2918] Merge StringIO/cStringIO in 3.0 [In reply to]

Alexandre Vassalotti <alexandre [at] peadrop> added the comment:

Committed in r64154.

----------
resolution: -> accepted
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue2918>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.