[issue14897] struct.pack raises unexpected error message

mesheb82 report at bugs.python.org
Thu May 24 08:21:59 CEST 2012


New submission from mesheb82 <mesheb82 at gmail.com>:

I found some unexpected behavior while working with the struct module.
>>> import struct

This works as expected:
>>> struct.pack('1s1s','3','4')
'34'

In this case, with bad input, the error message says I need 2 arguments, when I provide 2 arguments.
>>> struct.pack('1s1s','33')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
struct.error: pack requires exactly 2 arguments

----------
components: IO
messages: 161481
nosy: mesheb82
priority: normal
severity: normal
status: open
title: struct.pack raises unexpected error message
type: behavior
versions: Python 2.7, Python 3.2

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


More information about the Python-bugs-list mailing list