This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author bethard
Recipients bethard
Date 2010-07-23.13:27:10
SpamBayes Score 0.04656956
Marked as misclassified No
Message-id <1279891670.23.0.306869867423.issue9347@psf.upfronthosting.co.za>
In-reply-to
Content
What steps will reproduce the problem?

parser = argparse.ArgumentParser()
parser.add_argument('--foo', type=(int, float))

What is the expected output?

ValueError: (<type 'int'>, <type 'float'>) is not callable

What do you see instead?

TypeError: not all arguments converted during string formatting

Please provide any additional information below.

This is caused by calling using the % string formatting operator without
proper wrapping of the argument. The fix is basically:

-            raise ValueError('%r is not callable' % type_func)
+            raise ValueError('%r is not callable' % (type_func,))
History
Date User Action Args
2010-07-23 13:27:50bethardsetrecipients: + bethard
2010-07-23 13:27:50bethardsetmessageid: <1279891670.23.0.306869867423.issue9347@psf.upfronthosting.co.za>
2010-07-23 13:27:11bethardlinkissue9347 messages
2010-07-23 13:27:10bethardcreate