Re: [Python-Dev] Re: [Bug #121013] Bug in <stringobject>.join(<unicodestring>)

"M.-A. Lemburg" <mal@lemburg.com> writes:
Here's an effort, but it's a memory scribbling bug. If I change test_unicode.py thus: Index: test_unicode.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v retrieving revision 1.22 diff -c -r1.22 test_unicode.py *** test_unicode.py 2000/10/23 17:22:08 1.22 --- test_unicode.py 2000/11/28 08:49:11 *************** *** 70,76 **** # join now works with any sequence type class Sequence: ! def __init__(self): self.seq = 'wxyz' def __len__(self): return len(self.seq) def __getitem__(self, i): return self.seq[i] --- 70,76 ---- # join now works with any sequence type class Sequence: ! def __init__(self): self.seq = [u'w',u'x',u'y',u'z'] def __len__(self): return len(self.seq) def __getitem__(self, i): return self.seq[i] *************** *** 78,83 **** --- 78,87 ---- test('join', u'', u'abcd', (u'a', u'b', u'c', u'd')) test('join', u' ', u'w x y z', Sequence()) test('join', u' ', TypeError, 7) + test('join', ' ', u'a b c d', [u'a', u'b', u'c', u'd']) + test('join', '', u'abcd', (u'a', u'b', u'c', u'd')) + test('join', ' ', u'w x y z', Sequence()) + test('join', ' ', TypeError, 7) class BadSeq(Sequence): def __init__(self): self.seq = [7, u'hello', 123L] and back out the fix for the join bug, this happens: ... ... Testing Unicode formatting strings... done. Testing builtin codecs... Traceback (most recent call last): File "test_unicode.py", line 378, in ? assert unicode('hello','utf8') == u'hello' File "/usr/local/src/python/dist/build/Lib/encodings/__init__.py", line 30, in ? import codecs,aliases SystemError: compile.c:185: bad argument to internal function Segmentation fault i.e. it crashes miles away from the problem. I'll reply to the other stuff later - no time now. Cheers, M. -- The only problem with Microsoft is they just have no taste. -- Steve Jobs, (From _Triumph of the Nerds_ PBS special) and quoted by Aahz Maruch on comp.lang.python

Michael Hudson wrote:
The test is only supposed to assure that we don't trip again. It's not intended to work in some way *before* applying your patch. I always try to integrate tests for bugs into the test suites for my mx stuff and AFAICTL this also seems to be the Python dev style. -- Marc-Andre Lemburg ______________________________________________________________________ Company: http://www.egenix.com/ Consulting: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/

On Tue, 28 Nov 2000, M.-A. Lemburg wrote:
The test is only supposed to assure that we don't trip again. It's not intended to work in some way *before* applying your patch.
Yes. I don't know what I was thinking earlier. Too many beers last night, perhaps.
Do you want to check it in then? I can't. Cheers, M.

Michael Hudson wrote:
Best is to put it up on SF as patch. Someone will then pick it up and check it in sooner or later. In any case that'll prevent it getting lost. -- Marc-Andre Lemburg ______________________________________________________________________ Company: http://www.egenix.com/ Consulting: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/

Michael Hudson wrote:
The test is only supposed to assure that we don't trip again. It's not intended to work in some way *before* applying your patch. I always try to integrate tests for bugs into the test suites for my mx stuff and AFAICTL this also seems to be the Python dev style. -- Marc-Andre Lemburg ______________________________________________________________________ Company: http://www.egenix.com/ Consulting: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/

On Tue, 28 Nov 2000, M.-A. Lemburg wrote:
The test is only supposed to assure that we don't trip again. It's not intended to work in some way *before* applying your patch.
Yes. I don't know what I was thinking earlier. Too many beers last night, perhaps.
Do you want to check it in then? I can't. Cheers, M.

Michael Hudson wrote:
Best is to put it up on SF as patch. Someone will then pick it up and check it in sooner or later. In any case that'll prevent it getting lost. -- Marc-Andre Lemburg ______________________________________________________________________ Company: http://www.egenix.com/ Consulting: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/
participants (2)
-
M.-A. Lemburg
-
Michael Hudson