[New-bugs-announce] [issue23578] struct.pack error messages do not indicate which argument was invalid

Alistair Lynn report at bugs.python.org
Tue Mar 3 18:03:05 CET 2015


New submission from Alistair Lynn:

In this example:

  struct.pack('!hhhh', 0x5FFF, 0x6FFF, 0x7FFF, 0x8FFF)

Python errors that the 'h' format requires -32768 <= number <= 32767, but it does not indicate which of the arguments is at fault. In this contrived example it's clearly the fourth one, but in dealing with large amounts of data it would be useful to indicate which argument was invalid.

This would hopefully not be a functional change, just a slightly more helpful error message.

----------
components: Library (Lib)
messages: 237153
nosy: alynn
priority: normal
severity: normal
status: open
title: struct.pack error messages do not indicate which argument was invalid
type: enhancement
versions: Python 2.7, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23578>
_______________________________________


More information about the New-bugs-announce mailing list