Index: Python/ceval.c =================================================================== --- Python/ceval.c (revision 46582) +++ Python/ceval.c (working copy) @@ -2629,14 +2629,14 @@ SETLOCAL(i, x); } if (co->co_flags & CO_VARARGS) { - u = PyTuple_New(argcount - n); + u = PyList_New(argcount - n); if (u == NULL) goto fail; SETLOCAL(co->co_argcount, u); for (i = n; i < argcount; i++) { x = args[i]; Py_INCREF(x); - PyTuple_SET_ITEM(u, i-n, x); + PyList_SET_ITEM(u, i-n, x); } } for (i = 0; i < kwcount; i++) { Index: Doc/ref/ref5.tex =================================================================== --- Doc/ref/ref5.tex (revision 46582) +++ Doc/ref/ref5.tex (working copy) @@ -527,7 +527,7 @@ If there are more positional arguments than there are formal parameter slots, a \exception{TypeError} exception is raised, unless a formal parameter using the syntax \samp{*identifier} is present; in this -case, that formal parameter receives a tuple containing the excess +case, that formal parameter receives a list containing the excess positional arguments (or an empty tuple if there were no excess positional arguments). Index: Lib/re.py =================================================================== --- Lib/re.py (revision 46582) +++ Lib/re.py (working copy) @@ -218,7 +218,7 @@ def _compile(*key): # internal: compile pattern - cachekey = (type(key[0]),) + key + cachekey = (type(key[0]),) + tuple(key) p = _cache.get(cachekey) if p is not None: return p @@ -238,6 +238,7 @@ def _compile_repl(*key): # internal: compile replacement pattern + key = tuple(key) p = _cache_repl.get(key) if p is not None: return p Index: Lib/logging/__init__.py =================================================================== --- Lib/logging/__init__.py (revision 46582) +++ Lib/logging/__init__.py (working copy) @@ -235,8 +235,9 @@ # For the use case of passing a dictionary, this should not be a # problem. if args and (len(args) == 1) and args[0] and (type(args[0]) == types.DictType): - args = args[0] - self.args = args + self.args = args[0] + else: + self.args = tuple(args) self.levelname = getLevelName(level) self.levelno = level self.pathname = pathname Index: Lib/hotshot/__init__.py =================================================================== --- Lib/hotshot/__init__.py (revision 46582) +++ Lib/hotshot/__init__.py (working copy) @@ -73,4 +73,4 @@ allowed to propogate cleanly, while ensuring that profiling is disabled on the way out. """ - return self._prof.runcall(func, args, kw) + return self._prof.runcall(func, tuple(args), kw) Index: Lib/ctypes/test/test_callbacks.py =================================================================== --- Lib/ctypes/test/test_callbacks.py (revision 46582) +++ Lib/ctypes/test/test_callbacks.py (working copy) @@ -19,7 +19,7 @@ if typ == c_float: self.failUnlessAlmostEqual(result, arg, places=5) else: - self.failUnlessEqual(self.got_args, (arg,)) + self.failUnlessEqual(self.got_args, [arg]) self.failUnlessEqual(result, arg) PROTO = self.functype.im_func(typ, c_byte, typ) @@ -27,7 +27,7 @@ if typ == c_float: self.failUnlessAlmostEqual(result, arg, places=5) else: - self.failUnlessEqual(self.got_args, (-3, arg)) + self.failUnlessEqual(self.got_args, [-3, arg]) self.failUnlessEqual(result, arg) ################ Index: Lib/ctypes/__init__.py =================================================================== --- Lib/ctypes/__init__.py (revision 46582) +++ Lib/ctypes/__init__.py (working copy) @@ -76,6 +76,7 @@ prototype((ordinal number, dll object)[, paramflags]) -> foreign function exported by ordinal prototype((function name, dll object)[, paramflags]) -> foreign function exported by name """ + argtypes = tuple(argtypes) try: return _c_functype_cache[(restype, argtypes)] except KeyError: Index: Lib/cgi.py =================================================================== --- Lib/cgi.py (revision 46582) +++ Lib/cgi.py (working copy) @@ -96,6 +96,11 @@ def dolog(fmt, *args): """Write a log message to the log file. See initlog() for docs.""" + if len(args) == 1 and isinstance(args[0], dict): + args = args[0] + else: + args = tuple(args) + logfp.write(fmt%args + "\n") def nolog(*allargs): Index: Lib/urllib2.py =================================================================== --- Lib/urllib2.py (revision 46582) +++ Lib/urllib2.py (working copy) @@ -404,13 +404,13 @@ dict = self.handle_error meth_name = proto + '_error' http_err = 0 - args = (dict, proto, meth_name) + args + args = tuple([dict, proto, meth_name] + args) result = self._call_chain(*args) if result: return result if http_err: - args = (dict, 'default', 'http_error_default') + orig_args + args = tuple([dict, 'default', 'http_error_default'] + orig_args) return self._call_chain(*args) # XXX probably also want an abstract factory that knows when it makes Index: Lib/test/test_csv.py =================================================================== --- Lib/test/test_csv.py (revision 46582) +++ Lib/test/test_csv.py (working copy) @@ -98,7 +98,7 @@ quoting=csv.QUOTE_ALL skipinitialspace=True strict=False - args = args + (dialect,) + args.append(dialect) obj = ctor(*args) self.assertEqual(obj.dialect.delimiter, '-') self.assertEqual(obj.dialect.doublequote, False) Index: Lib/test/test_functional.py =================================================================== --- Lib/test/test_functional.py (revision 46582) +++ Lib/test/test_functional.py (working copy) @@ -26,7 +26,7 @@ def test_basic_examples(self): p = self.thetype(capture, 1, 2, a=10, b=20) self.assertEqual(p(3, 4, b=30, c=40), - ((1, 2, 3, 4), dict(a=10, b=30, c=40))) + ([1, 2, 3, 4], dict(a=10, b=30, c=40))) p = self.thetype(map, lambda x: x*10) self.assertEqual(p([1,2,3,4]), [10, 20, 30, 40]) @@ -67,29 +67,29 @@ # exercise special code paths for zero args in either partial # object or the caller p = self.thetype(capture) - self.assertEqual(p(), ((), {})) - self.assertEqual(p(1,2), ((1,2), {})) + self.assertEqual(p(), ([], {})) + self.assertEqual(p(1,2), ([1,2], {})) p = self.thetype(capture, 1, 2) - self.assertEqual(p(), ((1,2), {})) - self.assertEqual(p(3,4), ((1,2,3,4), {})) + self.assertEqual(p(), ([1,2], {})) + self.assertEqual(p(3,4), ([1,2,3,4], {})) def test_kw_combinations(self): # exercise special code paths for no keyword args in # either the partial object or the caller p = self.thetype(capture) - self.assertEqual(p(), ((), {})) - self.assertEqual(p(a=1), ((), {'a':1})) + self.assertEqual(p(), ([], {})) + self.assertEqual(p(a=1), ([], {'a':1})) p = self.thetype(capture, a=1) - self.assertEqual(p(), ((), {'a':1})) - self.assertEqual(p(b=2), ((), {'a':1, 'b':2})) + self.assertEqual(p(), ([], {'a':1})) + self.assertEqual(p(b=2), ([], {'a':1, 'b':2})) # keyword args in the call override those in the partial object - self.assertEqual(p(a=3, b=2), ((), {'a':3, 'b':2})) + self.assertEqual(p(a=3, b=2), ([], {'a':3, 'b':2})) def test_positional(self): # make sure positional arguments are captured correctly - for args in [(), (0,), (0,1), (0,1,2), (0,1,2,3)]: + for args in [[], [0], [0,1], [0,1,2], [0,1,2,3]]: p = self.thetype(capture, *args) - expected = args + ('x',) + expected = args + ['x'] got, empty = p('x') self.failUnless(expected == got and empty == {}) @@ -99,15 +99,15 @@ p = self.thetype(capture, a=a) expected = {'a':a,'x':None} empty, got = p(x=None) - self.failUnless(expected == got and empty == ()) + self.failUnless(expected == got and empty == []) def test_no_side_effects(self): # make sure there are no side effects that affect subsequent calls p = self.thetype(capture, 0, a=1) args1, kw1 = p(1, b=2) - self.failUnless(args1 == (0,1) and kw1 == {'a':1,'b':2}) + self.failUnless(args1 == [0,1] and kw1 == {'a':1,'b':2}) args2, kw2 = p() - self.failUnless(args2 == (0,) and kw2 == {'a':1}) + self.failUnless(args2 == [0] and kw2 == {'a':1}) def test_error_propagation(self): def f(x, y): Index: Lib/test/test_exceptions.py =================================================================== --- Lib/test/test_exceptions.py (revision 46582) +++ Lib/test/test_exceptions.py (working copy) @@ -292,7 +292,7 @@ expected = args[-1] try: if len(args) == 2: raise args[0] - else: raise apply(args[0], args[1]) + else: raise args[0](*args[1]) except BaseException, e: for checkArgName in expected.keys(): if repr(getattr(e, checkArgName)) != repr(expected[checkArgName]): Index: Lib/test/test_descr.py =================================================================== --- Lib/test/test_descr.py (revision 46582) +++ Lib/test/test_descr.py (working copy) @@ -1336,16 +1336,16 @@ def foo(*a): return a goo = classmethod(foo) c = C() - vereq(C.goo(1), (C, 1)) - vereq(c.goo(1), (C, 1)) - vereq(c.foo(1), (c, 1)) + vereq(C.goo(1), [C, 1]) + vereq(c.goo(1), [C, 1]) + vereq(c.foo(1), [c, 1]) class D(C): pass d = D() - vereq(D.goo(1), (D, 1)) - vereq(d.goo(1), (D, 1)) - vereq(d.foo(1), (d, 1)) - vereq(D.foo(d, 1), (d, 1)) + vereq(D.goo(1), [D, 1]) + vereq(d.goo(1), [D, 1]) + vereq(d.foo(1), [d, 1]) + vereq(D.foo(d, 1), [d, 1]) # Test for a specific crash (SF bug 528132) def f(cls, arg): return (cls, arg) ff = classmethod(f) @@ -1357,8 +1357,8 @@ veris(D.goo.im_self, D) veris(super(D,D).goo.im_self, D) veris(super(D,d).goo.im_self, D) - vereq(super(D,D).goo(), (D,)) - vereq(super(D,d).goo(), (D,)) + vereq(super(D,D).goo(), [D]) + vereq(super(D,d).goo(), [D]) # Verify that argument is checked for callability (SF bug 753451) try: @@ -1396,16 +1396,16 @@ def foo(*a): return a goo = staticmethod(foo) c = C() - vereq(C.goo(1), (1,)) - vereq(c.goo(1), (1,)) - vereq(c.foo(1), (c, 1,)) + vereq(C.goo(1), [1]) + vereq(c.goo(1), [1]) + vereq(c.foo(1), [c, 1,]) class D(C): pass d = D() - vereq(D.goo(1), (1,)) - vereq(d.goo(1), (1,)) - vereq(d.foo(1), (d, 1)) - vereq(D.foo(d, 1), (d, 1)) + vereq(D.goo(1), [1]) + vereq(d.goo(1), [1]) + vereq(d.foo(1), [d, 1]) + vereq(D.foo(d, 1), [d, 1]) def staticmethods_in_c(): if verbose: print "Testing C-based static methods..." @@ -1427,16 +1427,16 @@ def foo(*a): return a goo = classmethod(foo) c = C() - vereq(C.goo(1), (C, 1)) - vereq(c.goo(1), (C, 1)) - vereq(c.foo(1), (c, 1)) + vereq(C.goo(1), [C, 1]) + vereq(c.goo(1), [C, 1]) + vereq(c.foo(1), [c, 1]) class D(C): pass d = D() - vereq(D.goo(1), (D, 1)) - vereq(d.goo(1), (D, 1)) - vereq(d.foo(1), (d, 1)) - vereq(D.foo(d, 1), (d, 1)) + vereq(D.goo(1), [D, 1]) + vereq(d.goo(1), [D, 1]) + vereq(d.foo(1), [d, 1]) + vereq(D.foo(d, 1), [d, 1]) class E: # *not* subclassing from C foo = C.foo vereq(E().foo, C.foo) # i.e., unbound Index: Lib/test/test_inspect.py =================================================================== --- Lib/test/test_inspect.py (revision 46582) +++ Lib/test/test_inspect.py (working copy) @@ -108,7 +108,7 @@ self.assertEqual(varargs, 'g') self.assertEqual(varkw, 'h') self.assertEqual(inspect.formatargvalues(args, varargs, varkw, locals), - '(a=7, b=8, c=9, d=3, (e=4, (f=5,)), *g=(), **h={})') + '(a=7, b=8, c=9, d=3, (e=4, (f=5,)), *g=[], **h={})') class GetSourceBase(unittest.TestCase): # Subclasses must override. Index: Lib/test/test_itertools.py =================================================================== --- Lib/test/test_itertools.py (revision 46582) +++ Lib/test/test_itertools.py (working copy) @@ -844,6 +844,7 @@ >>> def repeatfunc(func, times=None, *args): ... "Repeat calls to func with specified arguments." ... " Example: repeatfunc(random.random)" +... args = tuple(args) ... if times is None: ... return starmap(func, repeat(args)) ... else: Index: Lib/test/test_atexit.py =================================================================== --- Lib/test/test_atexit.py (revision 46582) +++ Lib/test/test_atexit.py (working copy) @@ -20,7 +20,7 @@ sys.stdout = sys.__stdout__ sys.stderr = sys.__stderr__ atexit._exithandlers = save_handlers - self.assertEqual(s.getvalue(), "h4 (4,) {'kw': 'abc'}\nh4 () {}\nh1\n") + self.assertEqual(s.getvalue(), "h4 [4] {'kw': 'abc'}\nh4 [] {}\nh1\n") def test_order(self): # be sure handlers are executed in reverse order Index: Lib/test/test_with.py =================================================================== --- Lib/test/test_with.py (revision 46582) +++ Lib/test/test_with.py (working copy) @@ -103,7 +103,7 @@ def __exit__(self, *exc_info): self.exit_called = True - self.exit_args = exc_info + self.exit_args = tuple(exc_info) return Nested.__exit__(self, *exc_info) Index: Lib/test/output/test_pyexpat =================================================================== --- Lib/test/output/test_pyexpat (revision 46582) +++ Lib/test/output/test_pyexpat (working copy) @@ -15,9 +15,9 @@ 'xml-stylesheet' 'href="stylesheet.css"' Comment: ' comment data ' -Notation declared: ('notation', None, 'notation.jpeg', None) +Notation declared: ['notation', None, 'notation.jpeg', None] Unparsed entity decl: - ('unparsed_entity', None, 'entity.file', None, 'notation') + ['unparsed_entity', None, 'entity.file', None, 'notation'] Start element: 'root' {'attr1': 'value1', 'attr2': 'value2\xe1\xbd\x80'} NS decl: @@ -38,16 +38,16 @@ End of CDATA section End element: 'sub2' -External entity ref: (None, 'entity.file', None) +External entity ref: [None, 'entity.file', None] End element: 'root' PI: u'xml-stylesheet' u'href="stylesheet.css"' Comment: u' comment data ' -Notation declared: (u'notation', None, u'notation.jpeg', None) +Notation declared: [u'notation', None, u'notation.jpeg', None] Unparsed entity decl: - (u'unparsed_entity', None, u'entity.file', None, u'notation') + [u'unparsed_entity', None, u'entity.file', None, u'notation'] Start element: u'root' {u'attr1': u'value1', u'attr2': u'value2\u1f40'} NS decl: @@ -68,16 +68,16 @@ End of CDATA section End element: u'sub2' -External entity ref: (None, u'entity.file', None) +External entity ref: [None, u'entity.file', None] End element: u'root' PI: u'xml-stylesheet' u'href="stylesheet.css"' Comment: u' comment data ' -Notation declared: (u'notation', None, u'notation.jpeg', None) +Notation declared: [u'notation', None, u'notation.jpeg', None] Unparsed entity decl: - (u'unparsed_entity', None, u'entity.file', None, u'notation') + [u'unparsed_entity', None, u'entity.file', None, u'notation'] Start element: u'root' {u'attr1': u'value1', u'attr2': u'value2\u1f40'} NS decl: @@ -98,7 +98,7 @@ End of CDATA section End element: u'sub2' -External entity ref: (None, u'entity.file', None) +External entity ref: [None, u'entity.file', None] End element: u'root' Index: Lib/test/output/test_extcall =================================================================== --- Lib/test/output/test_extcall (revision 46582) +++ Lib/test/output/test_extcall (working copy) @@ -1,24 +1,24 @@ test_extcall -() {} -(1,) {} -(1, 2) {} -(1, 2, 3) {} -(1, 2, 3, 4, 5) {} -(1, 2, 3, 4, 5) {} -(1, 2, 3, 4, 5) {} -(1, 2, 3) {'a': 4, 'b': 5} -(1, 2, 3, 4, 5) {'a': 6, 'b': 7} -(1, 2, 3, 6, 7) {'a': 8, 'b': 9, 'x': 4, 'y': 5} +[] {} +[1] {} +[1, 2] {} +[1, 2, 3] {} +[1, 2, 3, 4, 5] {} +[1, 2, 3, 4, 5] {} +[1, 2, 3, 4, 5] {} +[1, 2, 3] {'a': 4, 'b': 5} +[1, 2, 3, 4, 5] {'a': 6, 'b': 7} +[1, 2, 3, 6, 7] {'a': 8, 'b': 9, 'x': 4, 'y': 5} TypeError: g() takes at least 1 argument (0 given) TypeError: g() takes at least 1 argument (0 given) TypeError: g() takes at least 1 argument (0 given) -1 () {} -1 (2,) {} -1 (2, 3) {} -1 (2, 3, 4, 5) {} -0 (1, 2) {} -0 (1, 2, 3) {} -1 () {'a': 1, 'b': 2, 'c': 3, 'd': 4} +1 [] {} +1 [2] {} +1 [2, 3] {} +1 [2, 3, 4, 5] {} +0 [1, 2] {} +0 [1, 2, 3] {} +1 [] {'a': 1, 'b': 2, 'c': 3, 'd': 4} {'a': 1, 'b': 2, 'c': 3} {'a': 1, 'b': 2, 'c': 3} g() got multiple values for keyword argument 'x' @@ -85,12 +85,12 @@ zabdv () {'d': 'dd'} -> zabdv() takes at least 2 non-keyword arguments (0 given) zabdv () {'a': 'aa', 'd': 'dd'} -> zabdv() takes at least 2 non-keyword arguments (1 given) zabdv () {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> zabdv() got an unexpected keyword argument 'e' -zabdv (1, 2) {} -> ok zabdv 1 2 d E () e +zabdv (1, 2) {} -> ok zabdv 1 2 d E [] e zabdv (1, 2) {'a': 'aa'} -> zabdv() got multiple values for keyword argument 'a' -zabdv (1, 2) {'d': 'dd'} -> ok zabdv 1 2 dd E () d +zabdv (1, 2) {'d': 'dd'} -> ok zabdv 1 2 dd E [] d zabdv (1, 2) {'a': 'aa', 'd': 'dd'} -> zabdv() got multiple values for keyword argument 'a' zabdv (1, 2) {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> zabdv() got multiple values for keyword argument 'a' -zabdv (1, 2, 3, 4, 5) {} -> ok zabdv 1 2 3 E (4, 5) e +zabdv (1, 2, 3, 4, 5) {} -> ok zabdv 1 2 3 E [4, 5] e zabdv (1, 2, 3, 4, 5) {'a': 'aa'} -> zabdv() got multiple values for keyword argument 'a' zabdv (1, 2, 3, 4, 5) {'d': 'dd'} -> zabdv() got multiple values for keyword argument 'd' zabdv (1, 2, 3, 4, 5) {'a': 'aa', 'd': 'dd'} -> zabdv() got multiple values for keyword argument 'a' @@ -99,13 +99,13 @@ zabdevk () {'a': 'aa'} -> zabdevk() takes at least 2 non-keyword arguments (1 given) zabdevk () {'d': 'dd'} -> zabdevk() takes at least 2 non-keyword arguments (0 given) zabdevk () {'a': 'aa', 'd': 'dd'} -> zabdevk() takes at least 2 non-keyword arguments (1 given) -zabdevk () {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> ok zabdevk aa bb dd ee () {} -zabdevk (1, 2) {} -> ok zabdevk 1 2 d e () {} +zabdevk () {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> ok zabdevk aa bb dd ee [] {} +zabdevk (1, 2) {} -> ok zabdevk 1 2 d e [] {} zabdevk (1, 2) {'a': 'aa'} -> zabdevk() got multiple values for keyword argument 'a' -zabdevk (1, 2) {'d': 'dd'} -> ok zabdevk 1 2 dd e () {} +zabdevk (1, 2) {'d': 'dd'} -> ok zabdevk 1 2 dd e [] {} zabdevk (1, 2) {'a': 'aa', 'd': 'dd'} -> zabdevk() got multiple values for keyword argument 'a' zabdevk (1, 2) {'a': 'aa', 'b': 'bb', 'd': 'dd', 'e': 'ee'} -> zabdevk() got multiple values for keyword argument 'a' -zabdevk (1, 2, 3, 4, 5) {} -> ok zabdevk 1 2 3 4 (5,) {} +zabdevk (1, 2, 3, 4, 5) {} -> ok zabdevk 1 2 3 4 [5] {} zabdevk (1, 2, 3, 4, 5) {'a': 'aa'} -> zabdevk() got multiple values for keyword argument 'a' zabdevk (1, 2, 3, 4, 5) {'d': 'dd'} -> zabdevk() got multiple values for keyword argument 'd' zabdevk (1, 2, 3, 4, 5) {'a': 'aa', 'd': 'dd'} -> zabdevk() got multiple values for keyword argument 'a' Index: Lib/test/test_scope.py =================================================================== --- Lib/test/test_scope.py (revision 46582) +++ Lib/test/test_scope.py (working copy) @@ -306,7 +306,7 @@ return lst return returner -vereq(makeReturner(1,2,3)(), (1,2,3)) +vereq(makeReturner(1,2,3)(), [1,2,3]) def makeReturner2(**kwargs): def returner(): Index: Lib/test/test_decorators.py =================================================================== --- Lib/test/test_decorators.py (revision 46582) +++ Lib/test/test_decorators.py (working copy) @@ -54,6 +54,7 @@ def memoize(func): saved = {} def call(*args): + args = tuple(args) try: return saved[args] except KeyError: @@ -100,7 +101,7 @@ return func return decorate - args = ( 'Now', 'is', 'the', 'time' ) + args = [ 'Now', 'is', 'the', 'time' ] kwds = dict(one=1, two=2) @noteargs(*args, **kwds) def f1(): return 42 @@ -110,12 +111,12 @@ @noteargs('terry', 'gilliam', eric='idle', john='cleese') def f2(): return 84 self.assertEqual(f2(), 84) - self.assertEqual(f2.dbval, (('terry', 'gilliam'), + self.assertEqual(f2.dbval, (['terry', 'gilliam'], dict(eric='idle', john='cleese'))) @noteargs(1, 2,) def f3(): pass - self.assertEqual(f3.dbval, ((1, 2), {})) + self.assertEqual(f3.dbval, ([1, 2], {})) def test_dbcheck(self): @dbcheck('args[1] is not None') Index: Lib/test/test_grammar.py =================================================================== --- Lib/test/test_grammar.py (revision 46582) +++ Lib/test/test_grammar.py (working copy) @@ -182,7 +182,7 @@ verify(v3.func_code.co_varnames == ('a', '(b, c)', 'rest', 'b', 'c')) else: vereq(v3.func_code.co_varnames, ('a', '.1', 'rest', 'b', 'c')) -verify(v3(1, (2, 3), 4) == (1, 2, 3, (4,))) +verify(v3(1, (2, 3), 4) == (1, 2, 3, [4])) def d01(a=1): pass d01() d01(1) Index: Lib/test/test_htmllib.py =================================================================== --- Lib/test/test_htmllib.py (revision 46582) +++ Lib/test/test_htmllib.py (working copy) @@ -14,7 +14,7 @@ return self.__anchors def anchor_bgn(self, *args): - self.__anchors.append(args) + self.__anchors.append(tuple(args)) class DeclCollector(htmllib.HTMLParser): def __init__(self, *args, **kw): Index: Lib/test/test_urllib2.py =================================================================== --- Lib/test/test_urllib2.py (revision 46582) +++ Lib/test/test_urllib2.py (working copy) @@ -115,7 +115,7 @@ def open(self, req, data=None): self.req, self.data = req, data def error(self, proto, *args): - self.proto, self.args = proto, args + self.proto, self.args = proto, tuple(args) class MockFile: def read(self, count=None): pass @@ -294,7 +294,7 @@ for expected, got in zip(calls, o.calls): handler, name, args, kwds = got self.assertEqual((handler, name), expected) - self.assertEqual(args, (req,)) + self.assertEqual(args, [req]) def test_handler_order(self): o = OpenerDirector() @@ -325,7 +325,7 @@ req = Request("http://example.com/") self.assertRaises(urllib2.URLError, o.open, req) - self.assertEqual(o.calls, [(handlers[0], "http_open", (req,), {})]) + self.assertEqual(o.calls, [(handlers[0], "http_open", [req], {})]) ## def test_error(self): ## # XXX this doesn't actually seem to be used in standard library, @@ -350,9 +350,9 @@ req = Request("http://example.com/") r = o.open(req) assert len(o.calls) == 2 - calls = [(handlers[0], "http_open", (req,)), + calls = [(handlers[0], "http_open", [req]), (handlers[2], "http_error_302", - (req, Unknown(), 302, "", {}))] + [req, Unknown(), 302, "", {}])] for expected, got in zip(calls, o.calls): handler, method_name, args = expected self.assertEqual((handler, method_name), got[:2]) Index: Lib/locale.py =================================================================== --- Lib/locale.py (revision 46582) +++ Lib/locale.py (working copy) @@ -140,7 +140,7 @@ raise ValueError("format() must be given exactly one %char " "format specifier") if additional: - formatted = percent % ((value,) + additional) + formatted = percent % ((value,) + tuple(additional)) else: formatted = percent % value # floats and decimal ints need special action!