Issue 27 in glumpy: 32/64 bit system problem - "(argument 1: <type 'exceptions.OverflowError'>: long int too long to convert" fix included)

32 views
Skip to first unread message

glu...@googlecode.com

unread,
Feb 26, 2013, 11:48:17 AM2/26/13
to Nicolas...@inria.fr
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 27 by fishpep...@gmail.com: 32/64 bit system problem - "(argument
1: <type 'exceptions.OverflowError'>: long int too long to convert" fix
included)
http://code.google.com/p/glumpy/issues/detail?id=27

What steps will reproduce the problem?
use glumpy under 32bit linux (ubuntu precise)

What is the expected output?
no error

What do you see instead?
Exception ctypes.ArgumentError: "argument 1:
<type 'exceptions.OverflowError'>: long int too long to convert" in <bound
method Bar.__del__ of <eye.Bar object at 0x964774c>> ignored

Fix:

diff --speed-large-files --minimal -ru glumpy-master.orig/glumpy/atb/raw.py
glumpy-master/glumpy/atb/raw.py
--- glumpy-master.orig/glumpy/atb/raw.py 2013-02-26
17:19:04.000000000 +0100
+++ glumpy-master/glumpy/atb/raw.py 2013-02-26 17:23:41.750427593 +0100
@@ -9,6 +9,7 @@
import ctypes, ctypes.util
from ctypes import c_int, c_char_p, c_void_p, py_object, c_char
+import sys
from constants import *

name = ctypes.util.find_library('AntTweakBar')
if not name:
@@ -48,12 +49,14 @@
TwEventSpecialGLUT = __dll__.TwEventSpecialGLUT
TwEventMouseWheelGLUT = __dll__.TwMouseWheel

-# On Mac OS Snow Leopard, the following definitions seems to be necessary
to
-# ensure 64bits pointers anywhere needed
-c_pointer = ctypes.c_ulonglong
-
-# In case of problem, this definition must be used
-#c_pointer = ctypes.c_void_p
+#detect 64bit
+if (sys.maxsize > 2**32):
+ # On Mac OS Snow Leopard, the following definitions seems to be
necessary to
+ # ensure 64bits pointers anywhere needed
+ c_pointer = ctypes.c_ulonglong
+else:
+ #normal
+ c_pointer = ctypes.c_void_p

TwGetLastError.restype = c_char_p
TwGetBarName.restype = c_char_p





--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

glu...@googlecode.com

unread,
Apr 11, 2013, 2:19:49 AM4/11/13
to Nicolas...@inria.fr
Updates:
Status: Fixed

Comment #1 on issue 27 by Nicolas...@gmail.com: 32/64 bit system
problem - "(argument 1: <type 'exceptions.OverflowError'>: long int too
long to convert" fix included)
http://code.google.com/p/glumpy/issues/detail?id=27

Thanks, it has been corrected.
Reply all
Reply to author
Forward
0 new messages