[New-bugs-announce] [issue11673] RawArray does not accept long

Robert Kern report at bugs.python.org
Fri Mar 25 20:47:14 CET 2011

New submission from Robert Kern <robert.kern at gmail.com>:

The constructor for multiprocessing.RawArray() takes an argument that is either an integer size or a sequence to initialize the contents. To determine if the argument is a size, it uses isinstance(x, int). This means that integers that happen to be Python longs cause an error. On Win64 systems, Python ints are still 32-bits, so valid sizes for arrays sometimes must be represented by Python longs.

Attached is a patch that uses operator.index() to determine if the object can be used as an integer size.

components: Library (Lib)
files: raw-array-long.diff
keywords: patch
messages: 132144
nosy: Robert.Kern
priority: normal
severity: normal
status: open
title: RawArray does not accept long
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file21396/raw-array-long.diff

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list