Issue41

Title Assertions with 2 arguments and second argument a tuple incorrect result
Priority bug Status resolved
Superseder Nosy List kayhayen
Assigned To kayhayen Keywords wrong_execution

Created on 2012-07-15.16:45:58 by kayhayen, last changed by kayhayen.

Messages
msg113 (view) Author: kayhayen Date: 2012-07-15.21:32:48
The real problem is that starting with Python2.7, the AssertionError exception is 
created immediately, and as such the tuple survives the code that was use it as 
an argument, so this is a change.

Fix scheduled for next hotfix release.
msg112 (view) Author: kayhayen Date: 2012-07-15.17:05:36
As found by CPython2.7 test suite, the normalization should also be done for 
"NULL" value, and the wrong exception value creation check, is now covered too.
msg111 (view) Author: kayhayen Date: 2012-07-15.16:48:00
And another code review result, CPython checks the result from normalization, if 
it really is an exception instance, and complains if it isn't. For compatibility, 
this should be merged too.
msg110 (view) Author: kayhayen Date: 2012-07-15.16:47:04
Doing code review, I noticed that "tuple exception types" are understood by 
CPython too. It will take the first element of tuples, until it finds a non-tuple 
or empty tuple.

Code for that shall be added too.
msg109 (view) Author: kayhayen Date: 2012-07-15.16:45:58
Code like this: 

raise AssertionError, (3,)

would create an AssertionError(3), whereas it should be AssertionError((3,)), 
which needs a fix.

The issue is that CPython internally adds the missing tuple-property to 
exception value before calling exception type, except it already has it.

We need to wrap value tuples into one element tuples and it's correct to do it 
for all exception values, then CPython run time doesn't have to do it.
History
Date User Action Args
2012-07-18 10:14:53kayhayensetstatus: testing -> resolved
title: Raising exceptions with 2 arguments and second argument a tuple incorrect result -> Assertions with 2 arguments and second argument a tuple incorrect result
2012-07-15 21:32:48kayhayensetstatus: chatting -> testing
messages: + msg113
2012-07-15 17:05:36kayhayensetmessages: + msg112
2012-07-15 16:50:49kayhayensetkeyword: + wrong_execution
2012-07-15 16:48:00kayhayensetmessages: + msg111
2012-07-15 16:47:04kayhayensetstatus: unread -> chatting
messages: + msg110
2012-07-15 16:45:58kayhayencreate