[issue2263] struct.pack() + numpy int raises SystemError

2017-03-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> third party
stage:  -> resolved
status: pending -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2263] struct.pack() + numpy int raises SystemError

2015-07-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
status: open - pending

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2263
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2263] struct.pack() + numpy int raises SystemError

2014-01-07 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@gmail.com:


--
nosy: +haypo

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2263
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2263] struct.pack() + numpy int raises SystemError

2013-07-16 Thread Yury V. Zaytsev

Yury V. Zaytsev added the comment:

As noted in issue5476, I've submitted a pull request for NumPy: 
ttps://github.com/numpy/numpy/pull/3526 .

I hope that this fixes this problem too: on Py2, I've added 
Py_TPFLAGS_INT_SUBCLASS, on Py3, NumPy doesn't inherit from int anymore, 
because it's not a fixed-width integer type.

I guess it makes sense to close this bug now.

--
nosy: +zaytsev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2263
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2263] struct.pack() + numpy int raises SystemError

2013-01-07 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy:  -serhiy.storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2263
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2263] struct.pack() + numpy int raises SystemError

2012-10-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

FYI Py_TPFLAGS_INT_SUBCLASS already not used in Python 3.x.

--
nosy: +serhiy.storchaka

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2263
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2263] struct.pack() + numpy int raises SystemError

2010-06-14 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
nosy: +mark.dickinson

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2263
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2263] struct.pack() + numpy int raises SystemError

2009-05-18 Thread engelbert gruber

engelbert gruber grub...@users.sourceforge.net added the comment:

issue5476 has a problem with timedelta(microseconds = int32(36))

interestingly 0 to 35 work , if the patch for this issue2263 is applied.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2263
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2263] struct.pack() + numpy int raises SystemError

2009-02-12 Thread engelbert gruber

engelbert gruber grub...@users.sourceforge.net added the comment:

Including Py_TPFLAGS_INT_SUBCLASS in numpy's BASEFLAGS cures this.
This is an external problem then.
But I could not find any reference to Py_TPFLAGS_*_SUBCLASS in the
documentation, that is a python problem.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2263
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2263] struct.pack() + numpy int raises SystemError

2009-02-12 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Ok, so Python has to improve its C-API documentation, and numpy to fix
its int types :)

--
assignee:  - georg.brandl
components: +Documentation -Library (Lib)
nosy: +georg.brandl, pitrou
priority:  - normal
versions: +Python 2.6, Python 3.0, Python 3.1 -Python 2.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2263
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2263] struct.pack() + numpy int raises SystemError

2009-02-09 Thread engelbert gruber

engelbert gruber grub...@users.sourceforge.net added the comment:

in 2.7 svn _struct.c 

formatdef native_table[] = {
  {'B',   sizeof(char),   0,  nu_ubyte,   np_ubyte},
formatdef bigendian_table[]
  {'B',   1,  0,  nu_ubyte,   bp_uint},
formatdef lilendian_table[]
{'B',   1,  0,  nu_ubyte,   lp_uint},

np_ubyte calls get_long b/lp_uint call get_wrapped_ulong which calls
#define PyInt_Check(op) \
  PyType_FastSubclass((op)-ob_type, Py_TPFLAGS_INT_SUBCLASS)

but ob_type is set to BASE flags INT_SUBCLASS i snot set.

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2263
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2263] struct.pack() + numpy int raises SystemError

2009-01-28 Thread engelbert gruber

engelbert gruber grub...@users.sourceforge.net added the comment:

on ubuntu 8.04, Python 2.7a0 (trunk:69044) and numpy 1.2.1
(. is OK, e means SystemError)

* signed always works, longlong also.
* unsigned native works half of the time
* unsigned little/big endian never works
* the numpy type does seam to have any effect.

signed char  b   'int16'   .  .  .  'uint32'   .  .  . 
sys:1: DeprecationWarning: struct integer overflow masking is deprecated
unsigned charB   'int16'   .  e  e  'uint32'   .  e  e 
signed short h   'int16'   .  .  .  'uint32'   .  .  . 
unsigned short   H   'int16'   .  e  e  'uint32'   .  e  e 
signed int   i   'int16'   .  .  .  'uint32'   .  .  . 
unsigned int I   'int16'   e  e  e  'uint32'   e  e  e 
signed long  l   'int16'   .  .  .  'uint32'   .  .  . 
unsigned longL   'int16'   e  e  e  'uint32'   e  e  e 
signed long long q   'int16'   .  .  .  'uint32'   .  .  . 
unsigned long long   Q   'int16'   .  .  .  'uint32'   .  .  .

--
nosy: +grubert
versions: +Python 2.7
Added file: http://bugs.python.org/file12888/issue2263-numpy.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2263
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2263] struct.pack() + numpy int raises SystemError

2008-03-10 Thread Just van Rossum

New submission from Just van Rossum [EMAIL PROTECTED]:

struct.pack() raises SystemError when fed a numpy integer in some cases. 
The following was run on MacOSX 10.4, little endian (I can only 
reproduce the error if I specify big endian for the struct format). Not 
sure if this could be a numpy bug.

Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) 
[GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin
Type help, copyright, credits or license for more information.
 import struct
 import numpy
 i = numpy.int16(1)
 struct.pack(B, i)
__main__:1: DeprecationWarning: struct integer overflow masking is 
deprecated
Traceback (most recent call last):
  File stdin, line 1, in module
  File 
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/struct.
py, line 63, in pack
return o.pack(*args)
SystemError: /Users/ronald/r252/Objects/longobject.c:322: bad argument 
to internal function
 struct.pack(H, i)
Traceback (most recent call last):
  File stdin, line 1, in module
  File 
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/struct.
py, line 63, in pack
return o.pack(*args)
SystemError: /Users/ronald/r252/Objects/longobject.c:322: bad argument 
to internal function
 struct.pack(h, i)
'\x00\x01'
 struct.pack(b, i)
'\x01'
 struct.pack(B, i)
'\x01'
 struct.pack(h, i)
'\x01\x00'
 numpy.__version__
'1.0.4'


--
components: Library (Lib)
messages: 63435
nosy: jvr
severity: normal
status: open
title: struct.pack() + numpy int raises SystemError
type: behavior
versions: Python 2.5

__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2263
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com