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 serhiy.storchaka
Recipients mark.dickinson, mesheb82, serhiy.storchaka
Date 2012-05-24.09:33:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1337851995.2589.40.camel@raxxla>
In-reply-to <1337849251.4.0.70828891518.issue14897@psf.upfronthosting.co.za>
Content
> It might help if the error message also stated how many arguments were actually received, like the TypeError message already does for bad function / method calls.  E.g., 
> 
> "struct.error: pack expected 2 items for packing (got 1)"

Yes, this would be useful. But seldom implemented.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: not enough arguments for format string
>>> '%s %s'%(123,456,789)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: not all arguments converted during string formatting

struct.pack also inconsistent in other error messages.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
struct.error: argument for 's' must be a bytes object
>>> struct.pack('i', '123')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
struct.error: required argument is not an integer

For "s" is mentioned format, and for "i" no. It would be helpful to
mention also the number of the item.
History
Date User Action Args
2012-05-24 09:33:34serhiy.storchakasetrecipients: + serhiy.storchaka, mark.dickinson, mesheb82
2012-05-24 09:33:34serhiy.storchakalinkissue14897 messages
2012-05-24 09:33:34serhiy.storchakacreate