classification
Title: from struct import * misses pack_into
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: belopolsky Nosy List: SilentGhost, belopolsky, georg.brandl, mark.dickinson
Priority: normal Keywords: easy, patch

Created on 2011-01-31 17:21 by SilentGhost, last changed 2011-01-31 19:28 by belopolsky. This issue is now closed.

Files
File name Uploaded Description Edit
struct.py.diff SilentGhost, 2011-01-31 17:21
Messages (4)
msg127625 - (view) Author: SilentGhost (SilentGhost) * (Python triager) Date: 2011-01-31 17:21
the following issue was introduced in r81947:

>>> from struct import *
>>> pack_into
Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    pack_into
NameError: name 'pack_into' is not defined

struct.__all__ has a duplicate entry for "unpack" and misses "pack_into".

Patch is attached, test passes. Seems quite innocent to me, could it make into 3.2, George?

Related: #8973 and #11078
msg127628 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2011-01-31 17:33
I would say if anything can go in after rc2 at all, this should be accepted.  George?

I ran a few sanity checks with the patch applied:

>>> set(struct.__all__) - set(dir(struct))
set()
>>> set(dir(struct)) - set(struct.__all__)
{'_clearcache', '__all__', '__builtins__', '__file__', '__package__', '__cached__', '__name__', '__doc__'}
>>> len(set(struct.__all__)) == len(struct.__all__)
True

LGTM.  Maybe one of the tests above can be converted to a unit test.
msg127641 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2011-01-31 18:53
Yes, this can go in.
msg127649 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2011-01-31 19:28
Committed in revision 88280.
History
Date User Action Args
2011-01-31 19:28:38belopolskysetstatus: open -> closed
nosy: georg.brandl, mark.dickinson, belopolsky, SilentGhost
messages: + msg127649

resolution: fixed
stage: commit review -> resolved
2011-01-31 18:53:38georg.brandlsetassignee: georg.brandl -> belopolsky
messages: + msg127641
nosy: georg.brandl, mark.dickinson, belopolsky, SilentGhost
2011-01-31 17:35:45belopolskysetnosy: georg.brandl, mark.dickinson, belopolsky, SilentGhost
stage: commit review
2011-01-31 17:35:17belopolskylinkissue11078 dependencies
2011-01-31 17:33:42belopolskysetassignee: georg.brandl
versions: + Python 3.2, - Python 3.3
messages: + msg127628
nosy: georg.brandl, mark.dickinson, belopolsky, SilentGhost
2011-01-31 17:21:58SilentGhostcreate