Message161493
| 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. |
|