[Python-bugs-list] [ python-Bugs-635969 ] No error "not all arguments converted"

noreply@sourceforge.net noreply@sourceforge.net
Sun, 10 Nov 2002 07:45:02 -0800


Bugs item #635969, was opened at 2002-11-09 12:53
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=635969&group_id=5470

Category: Python Interpreter Core
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Martin v. Löwis (loewis)
Assigned to: Nobody/Anonymous (nobody)
>Summary: No error "not all arguments converted"

Initial Comment:
The expression 

r'.po$' % "hallo"

used to give an error, but now succeeds and gives the
string '.po'. I think producing the error should be
restored.

----------------------------------------------------------------------

>Comment By: Neal Norwitz (nnorwitz)
Date: 2002-11-10 10:45

Message:
Logged In: YES 
user_id=33168

I'm pretty sure this change (between 2.2.2 and 2.3) in
stringobject.c is the problem:

@@ -3320,7 +3623,7 @@
                arglen = -1;
                argidx = -2;
        }
-       if (args->ob_type->tp_as_mapping)
+       if (args->ob_type->tp_as_mapping &&
!PyTuple_Check(args))
                dict = args;

Now for non-tuples, dict is set.  dict is used later on to
determine if an exception should be set.
This still works, ie produces the exception:  (r'.po$' %
"hallo",)

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=635969&group_id=5470