[issue22379] Empty exception message of str.join

2014-09-28 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0ad19246d16d by Benjamin Peterson in branch '2.7': give exception a nice message (closes #22379) https://hg.python.org/cpython/rev/0ad19246d16d New changeset ab1570d0132d by Benjamin Peterson in branch '3.4': check that exception messages are not em

[issue22379] Empty exception message of str.join

2014-09-27 Thread Yongzhi Pan
Yongzhi Pan added the comment: Do the patches still have problems? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue22379] Empty exception message of str.join

2014-09-16 Thread R. David Murray
R. David Murray added the comment: No, you are right and I am wrong. I should have checked myself :) -- ___ Python tracker ___ ___ Py

[issue22379] Empty exception message of str.join

2014-09-16 Thread Yongzhi Pan
Yongzhi Pan added the comment: I tested it and find str of an exception does not contain the exception type: >>> a = TypeError() >>> str(a) '' >>> a = TypeError('b', 3) >>> a.args ('b', 3) >>> str(a) "('b', 3)" Am I missing some other circumstances? --

[issue22379] Empty exception message of str.join

2014-09-15 Thread R. David Murray
R. David Murray added the comment: The str of the exception will always be nonblank (it will contain the string 'TypeError' at a minimum). So you need to peel off the 'TypeError:' prefix before testing if you want to use str(e). That's why I suggested using args[0], but I suppose that might

[issue22379] Empty exception message of str.join

2014-09-15 Thread Yongzhi Pan
Yongzhi Pan added the comment: I have updated the test for 3.5. The related tests pass after the patching. Are they OK now? There are two caveats: I did not update test_bytes in 2.7, and I did not add checkraises in test_bytes in 3.5. -- Added file: http://bugs.python.org/file36621/t

[issue22379] Empty exception message of str.join

2014-09-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > You can check .args[0] in python3. Or str(cm.exception). This works on 2.7 too. -- nosy: +serhiy.storchaka ___ Python tracker ___ _

[issue22379] Empty exception message of str.join

2014-09-12 Thread R. David Murray
R. David Murray added the comment: You can check .args[0] in python3. Can you include a complete patch for python3? Your test_for_35 only has a change for test_bytes, not the ones for string_tests. -- ___ Python tracker

[issue22379] Empty exception message of str.join

2014-09-12 Thread Yongzhi Pan
Yongzhi Pan added the comment: I updated the patches. Since exceptions in 3 do not have a message attribute, I did not check them. Are they OK? -- Added file: http://bugs.python.org/file36605/test_for_35.diff ___ Python tracker

[issue22379] Empty exception message of str.join

2014-09-11 Thread Yongzhi Pan
Changes by Yongzhi Pan : -- versions: +Python 3.5 Added file: http://bugs.python.org/file36604/str_join_exception_message_1.diff ___ Python tracker ___ __

[issue22379] Empty exception message of str.join

2014-09-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue22379] Empty exception message of str.join

2014-09-10 Thread R. David Murray
R. David Murray added the comment: Thanks for the report and patch. The test doesn't fail before your patch. I think checkraises should be changed to make sure the message isn't empty. And yes, the tests should be added to 3.5. -- components: +Interpreter Core -ctypes nosy: +r.david.

[issue22379] Empty exception message of str.join

2014-09-09 Thread Yongzhi Pan
New submission from Yongzhi Pan: In the 2.7 branch, the exception message of str.join is missing when the argument is non-sequence: >>> ' '.join(None) Traceback (most recent call last): File "", line 1, in TypeError I fix this with a patch. After this: >>> ' '.join(None) Traceback (most re