Re: ctypes and misaligned doubles

2008-12-11 Thread Thomas Heller
Jan Roelens schrieb: Dear python experts, How can I change the alignment of types in the ctypes package? I have a library that was built with gcc using the -malign-double option. I also have python code that can create ctypes wrapper code from the include files for that library. The problem

[issue4632] Wrong fix for range(42)[::-1]

2008-12-11 Thread Thomas Heller
New submission from Thomas Heller [EMAIL PROTECTED]: The 2to3 fixer translates this code: range(42)[::-1] into this one: list(range(42)[::-1] which throws an error when run with Python 3: Traceback (most recent call last): File test.py, line 1, in module print(list(range(42)[::-1

[issue4636] bdist_wininst installer with install script raises exception

2008-12-11 Thread Thomas Heller
New submission from Thomas Heller thel...@ctypes.org: Running a bdist_wininst installer that contains a install script, with python 3, raises an exception. This is displayed in the gui: ImportError: No module named __builtin__ *** run_installscript: internal error 0x

[issue4303] [2.5 regression] ctypes fails to build on arm-linux-gnu

2008-12-10 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Is this really a regression? I do not think so; the libffi library included with the Python 2.5 ctypes does not support closures on the arm. See file Modules/_ctypes/libffi/src/arm/ffitarget.h, it contains '#define FFI_CLOSURES 0

[issue4303] [2.5 regression] ctypes fails to build on arm-linux-gnu

2008-12-10 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: It seems that ffi_info moved into ctypes.h: could that have caused the breakage? Not sure what you mean exactly (there is no ffi_info in ctypes.h), but I assume you are referring to svn rev. 62504

[issue887237] Machine integers

2008-12-10 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: One difficulty with the patch is that the original ctypes code contained a tp_as_number ... This can be solved by changing the order of bases for c_type classes. See attached. Cool! Why didn't I think of that myself

Re: Checking if an int fits in 32 bits?

2008-12-04 Thread Thomas Heller
Roy Smith schrieb: I'm working with marshaling data over a binary wire protocol. I'm using struct.pack() to handle the low-level encoding of ints. One of the things I need to do is make sure an int can be represented in 4 bytes. Is there a portable way to do that? For now, I'm doing signed

[issue4376] Nested ctypes 'BigEndianStructure' fails

2008-11-27 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Currently, the _fields_ of ctypes Structures with non-native byte order can only contain simple types (like int, char, but not pointers), and arrays of those. Since this is all Python code (in Lib/ctypes/endian.py) it should be possible

[issue4376] Nested ctypes 'BigEndianStructure' fails

2008-11-27 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Correction: Since this is all Python code (in Lib/ctypes/_endian.py) it should be ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4376

[issue4433] _ctypes.COMError crash

2008-11-26 Thread Thomas Heller
New submission from Thomas Heller [EMAIL PROTECTED]: The following code, which only works on Windows, crashes with an access violation somewhere in the garbage collector in a debug build: import _ctypes [43470 refs] _ctypes.COMError(1, 2, 3) The problem is that the PyComError_Type's tp_flags

[issue4429] ctypes.FormatError raises when the string to return contains non-ascii characters

2008-11-26 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Thanks for the review. I commited the 'better' patch plus a NEWS entry as svn rev. 67391. -- resolution: - fixed status: open - closed type: - crash ___ Python tracker [EMAIL PROTECTED] http

[issue4433] _ctypes.COMError crash

2008-11-26 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Thanks for the review; committed as svn rev. 67402. -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4433

[issue4427] Docs for 'y' Py_BuildValue tag are wrong

2008-11-25 Thread Thomas Heller
Changes by Thomas Heller [EMAIL PROTECTED]: -- assignee: georg.brandl components: Documentation files: doc.patch keywords: patch, patch nosy: georg.brandl, theller severity: normal stage: patch review status: open title: Docs for 'y' Py_BuildValue tag are wrong versions: Python 3.0

[issue4429] ctypes.FormatError raises when the string to return contains non-ascii characters

2008-11-25 Thread Thomas Heller
New submission from Thomas Heller [EMAIL PROTECTED]: ctypes raises UnicodeDecodeError in german windows (it should print 'Unzulässige Funktion'): from ctypes import FormatError [46681 refs] FormatError(1) Traceback (most recent call last): File stdin, line 1, in module UnicodeDecodeError

[issue4429] ctypes.FormatError raises when the string to return contains non-ascii characters

2008-11-25 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: The simple patch (ctypes-simple.patch) uses the 'y' format tag for PyBuild_Value to build a bytes object as error message. -- keywords: +patch Added file: http://bugs.python.org/file12129/ctypes-simple.patch

[issue4429] ctypes.FormatError raises when the string to return contains non-ascii characters

2008-11-25 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: The 'better' patch changes the internal FormatError function to return a wide string; so conversion from ascii to unicode by Python functions is not needed and it returns strings to the caller: from ctypes import FormatError [46681 refs

[issue4429] ctypes.FormatError raises when the string to return contains non-ascii characters

2008-11-25 Thread Thomas Heller
Changes by Thomas Heller [EMAIL PROTECTED]: -- keywords: +needs review ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4429 ___ ___ Python-bugs-list

Re: C extension type gives type error in power operator

2008-11-20 Thread Thomas Heller
Paul Moore schrieb: I'm trying to implement an extension type with a power operator. The operator is unusual in that I want to allow my objects to be raised to an integer power: p = Pattern() p3 = p ** 3 I've implemented the code for a nb_power slot, it converts the other argument

[issue4358] Segfault in stringobject.c

2008-11-19 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Has nothing to do with ctypes (the package), unassigning. -- components: -ctypes ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4358

[issue4358] Segfault in stringobject.c

2008-11-19 Thread Thomas Heller
Changes by Thomas Heller [EMAIL PROTECTED]: -- assignee: theller - nosy: -theller ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4358 ___ ___ Python

[issue887237] Machine integers

2008-11-15 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: I wonder if a patch for ctypes like this (which is not yet complete) could be used to implement this, or MUST it be implemented in C? The patch contains a mixin class that implements the numeric methods. However, the actual operation takes

[issue4260] ctypes.xFUNCTYPE are decorators.

2008-11-06 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: [David Lambert] @CFUNCTYPE(c_int, POINTER(c_int), POINTER(c_int)) def py_cmp_func(*args): (a,b,) = (t[0] for t in args) print(py_cmp_func, a, b) return a-b qsort(ia,len(ia),sizeof(c_int),py_cmp_func) [Kevin Watters

Re: Passing a memory address (pointer) to an extension?

2008-10-23 Thread Thomas Heller
Philip Semanchuk schrieb: I'm writing a Python extension in C that wraps a function which takes a void * as a parameter. (The function is shmat() which attaches a chunk of shared memory to the process at the address supplied by the caller.) I would like to expose this function to Python,

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Thomas Heller
Andy schrieb: Dear Python dev community, [...] Basically, we use embedded python and use it to wrap our high performance C++ class set which wraps OpenGL, DirectX and our own software renderer. In addition to wrapping our C++ frameworks, we use python to perform various worker tasks on

[issue4075] Use WCHAR variant of OutputDebugString

2008-10-11 Thread Thomas Heller
Changes by Thomas Heller [EMAIL PROTECTED]: -- nosy: +theller ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4075 ___ ___ Python-bugs-list mailing list

Re: python 3: sorting with a comparison function

2008-10-10 Thread Thomas Heller
Thomas Heller wrote: Does Python 3 have no way anymore to sort with a comparison function? Both [].sort() and sorted() seem to accept only 'key' and 'reverse' arguments, the 'cmp' argument seems to be gone. Can that be? Terry Reedy schrieb: Yes. When this was discussed, no one could

Re: python 3: sorting with a comparison function

2008-10-10 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: Kay Schluehr: Sometimes it helps when people just make clear how they use technical terms instead of invoking vague associations. And generally Python docs can enjoy growing few thousands examples... Well, that may not be necessary. But I think that a clear

[issue4089] linking python2.6.dll crash on windows xp

2008-10-10 Thread Thomas Heller
Changes by Thomas Heller [EMAIL PROTECTED]: -- resolution: - invalid status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4089

Re: no unbound methods in py3k

2008-10-09 Thread Thomas Heller
Christian Heimes schrieb: Thomas Heller wrote: but this is very ugly, imo. Is there another way? The raw_func instances that I have are not descriptors (they do not implement a __get__() method...) I've written PyInstanceMethod_Type for this use case. It's not (yet) available for Python

python 3: sorting with a comparison function

2008-10-09 Thread Thomas Heller
Does Python 3 have no way anymore to sort with a comparison function? Both [].sort() and sorted() seem to accept only 'key' and 'reverse' arguments, the 'cmp' argument seems to be gone. Can that be? Thomas -- http://mail.python.org/mailman/listinfo/python-list

Re: no unbound methods in py3k

2008-10-09 Thread Thomas Heller
Terry Reedy schrieb: Thomas Heller wrote: Christian Heimes schrieb: I've written PyInstanceMethod_Type for this use case. It's not (yet) available for Python code. Oh, wait - there's ctypes: Python 3.0rc1 (r30rc1:66507, Sep 18 2008, 14:47:08) [MSC v.1500 32 bit (Intel)] on win32 Type

Re: no unbound methods in py3k

2008-10-09 Thread Thomas Heller
Christian Heimes schrieb: Thomas Heller wrote: Ok, so one has to write an extension to access or expose it. Oh, wait - there's ctypes: I wrote the type to help the Pyrex and Cython developers to port their software to 3.0. I planed to expose the type as __builtin__.instancemethod

[issue4072] build_py support for lib2to3 is stale

2008-10-09 Thread Thomas Heller
Changes by Thomas Heller [EMAIL PROTECTED]: -- nosy: +theller ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4072 ___ ___ Python-bugs-list mailing list

[issue4073] distutils build_scripts and install_data commands need 2to3 support

2008-10-09 Thread Thomas Heller
Changes by Thomas Heller [EMAIL PROTECTED]: -- nosy: +theller ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4073 ___ ___ Python-bugs-list mailing list

[issue4091] python dll not installed in windows system directory

2008-10-09 Thread Thomas Heller
New submission from Thomas Heller [EMAIL PROTECTED]: Python 2.6 final and Python 3.0 rc1 do NOT install the python dlls into the windows system directory, even when installing 'for all users' and with admin rights. This causes problems with COM objects implemented in Python. Observed

no unbound methods in py3k

2008-10-08 Thread Thomas Heller
I'm currently using code like this to create unbound methods from functions and stick them into classes: method = new.instancemethod(raw_func, None, cls) setattr(cls, name, method) Ok, python 2.6, run with the -3 flag, gives a warning that the new module is going away in python 3.0, so the

Re: how to get the thighest bit position in big integers?

2008-10-07 Thread Thomas Heller
Mark Dickinson schrieb: On Oct 5, 11:40 pm, Terry Reedy [EMAIL PROTECTED] wrote: Your point, that taking floor(log2(x)) is redundant, is a good catch. However, you should have added 'untested' ;-). When value has more significant bits than the fp mantissa can hold, this expression can be 1

[issue3547] Ctypes is confused by bitfields of varying integer types

2008-09-29 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Committed as SVN rev 66683 (trunk), 66684 (py3k), and 66685 (release25-maint). -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3547

[issue3547] Ctypes is confused by bitfields of varying integer types

2008-09-26 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Ok, here is an additional patch bitfields-mingw.patch. It fixes the problem reported by rpetrov, and updates the comments. Please review again ;-). The previous patch bitfields-3.patch has already been applied. Added file: http

[issue3547] Ctypes is confused by bitfields of varying integer types

2008-09-25 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Does the following patch fix the test failure with MingW? patch Index: cfield.c === --- cfield.c(revision 66611) +++ cfield.c(working copy) @@ -65,10 +65,10

[issue3547] Ctypes is confused by bitfields of varying integer types

2008-09-24 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Fredrik Lundh schrieb: Looks fine to me, except for the comment in the test suite. Should +# MS compilers do NOT combine c_short and c_int into +# one field, gcc doesn't. perhaps be +# MS compilers do

[issue3547] Ctypes is confused by bitfields of varying integer types

2008-09-24 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Skip Montanaro schrieb: Looks reasonable, though I'm no ctypes maven. Trivial little nit: In the comment just before the start of CField_FromDesc it says, in part: * Expects the size, index and offset for the current field in *psize

[issue3547] Ctypes is confused by bitfields of varying integer types

2008-09-23 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Make this a release blocker so hopefully someone will review it. -- priority: - release blocker ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3547

Re: Directshow in Python

2008-09-19 Thread Thomas Heller
Sayanan Sivaraman schrieb: Hey all, I'm trying to use DirectShow to display videos [I'm kind of new to Python, from more of a C++ background on windows]. I found some sample code online, but I am having trouble with calling the I import ctypes from ctypes import * from comtypes import

[issue3547] Ctypes is confused by bitfields of varying integer types

2008-09-18 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Updated patch. Added file: http://bugs.python.org/file11514/bitfields-2.patch ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3547

[issue3547] Ctypes is confused by bitfields of varying integer types

2008-09-18 Thread Thomas Heller
Changes by Thomas Heller [EMAIL PROTECTED]: Removed file: http://bugs.python.org/file11513/bitfields.patch ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3547

[issue3547] Ctypes is confused by bitfields of varying integer types

2008-09-18 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Updated the unittest so that it works on Windows, too. Added file: http://bugs.python.org/file11515/bitfields-3.patch ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3547

[issue3547] Ctypes is confused by bitfields of varying integer types

2008-09-18 Thread Thomas Heller
Changes by Thomas Heller [EMAIL PROTECTED]: Removed file: http://bugs.python.org/file11514/bitfields-2.patch ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3547

[issue3102] ctypes defines global symbols

2008-09-18 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Is it too late to fix this for Python 2.6 and Python 3.0? ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3102

[issue3900] ctypes: wrong calling convention for _string_at

2008-09-18 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: This is already fixed in SVN, see issue #3554. -- assignee: - theller nosy: +theller resolution: - duplicate status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org

[issue3870] Parser/asdl_c.py requires python in order to build python

2008-09-17 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: I think it would be a good idea to change the Makefile so that it touches these files when no python interpreter is available. -- nosy: +theller ___ Python tracker [EMAIL PROTECTED] http

[issue3547] Ctypes is confused by bitfields of varying integer types

2008-09-17 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Here is a patch, with test, that fixes this problem. -- keywords: +needs review, patch Added file: http://bugs.python.org/file11513/bitfields.patch ___ Python tracker [EMAIL PROTECTED] http

Re: handling uncaught exceptions with pdb?

2008-09-12 Thread Thomas Heller
Paul Rubin schrieb: I think I've asked about this before, but is there a way to set up Python to handle uncaught exceptions with pdb? I know about setting sys.except_hook to something that calls pdb, but this is normally done at the outer level of a program, and by the time that hook gets

[issue2145] ctypes.util.find_library(): posix .so without SONAME

2008-09-09 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Cool. -- resolution: - invalid status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2145

Re: ctypes error on Windows

2008-09-05 Thread Thomas Heller
Fredrik Lundh schrieb: Fredrik Lundh wrote: I do have the tidy.dll installed (if I didn't, I couldn't even import the tidy module). typing the following into the Python interpreter might give you some more clues: import _tidy _tidy.__file__ dir(_tidy) or not,

[issue3785] Can't build ctypes of Python 2.5.2 with Sun Studio 12

2008-09-05 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: The libffi library in Python 2.5 is too old and won't be upgraded to a newer version. I see several possibilities for you: - Use Python 2.6 (if you can live with the beta or wait for the release) - Use Python 2.5, compile with GCC - Use

Re: ctypes version mismatch

2008-08-29 Thread Thomas Heller
Paul McNett schrieb: Anyone have anything to suggest on this error: {{{ Traceback (most recent call last): File shutter_studio.py, line 41, in module File App.pyo, line 25, in module File ui\__init__.pyo, line 23, in module File ui\FrmProductionOrders.pyo, line 10, in module

Re: logging - how to use in a library?

2008-08-29 Thread Thomas Heller
Vinay Sajip schrieb: On Aug 27, 11:28 am, Thomas Heller [EMAIL PROTECTED] wrote: I came up with a workaround that seems to do what I want. I add a NULL handler to my top-level logger which is not the root logger but a logger named 'comtypes', other loggers are named 'comtypes.something

Re: logging - how to use in a library?

2008-08-27 Thread Thomas Heller
Vinay Sajip schrieb: Suppose a user of logging configures it wrongly by mistake, so that there are no handlers configured. In this case, if the logging system were not to output anything at all, then you would have no information at all about why - leading to a longer time to diagnose the

logging - how to use in a library?

2008-08-26 Thread Thomas Heller
I'm using the logging module in my comtypes library to log 'interesting' things that happen. In other words, the idea is if the user of the library is interested in the details that happen in the package internally, he (she?) would configure a logging level and handlers that write the log

[issue2764] c_char doesn't implement py3k buffer interface

2008-08-22 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: The test has already been fixed and reenabled in rev 65849. -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2764

[issue2404] Backport ctypes support for buffer protocol to Python 2.6 (ref issue1971)

2008-08-22 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: I forgot to close this issue. Already implemented in svn rev 63962. -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2404

[issue3612] Add some basic mssing types in ctypes.wintypes

2008-08-20 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: I have no objections against this patch - feel free to check it in if it is not too late before the beta. Also I think that LPDWORD and friends are a good idea, you should extend the patch with them. -- assignee: theller - ocean-city

[issue3617] Add MS EULA to the list of third-party licenses in the Windows installer

2008-08-20 Thread Thomas Heller
Changes by Thomas Heller [EMAIL PROTECTED]: -- nosy: +theller ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3617 ___ ___ Python-bugs-list mailing list

[issue3612] Add some basic mssing types in ctypes.wintypes

2008-08-20 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: I think this is too fancy. I would prefer to spell the definitions out like this: LPDWORD = PDWORD = POINTER(DWORD) LPCSTR = LPSTR = c_wchar_p We could avoid the giant __all__ list when we 'import ctypes as _ctypes' and write (for example

[issue3554] ctypes.wstring_at and string_at call Python API without the GIL

2008-08-19 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: This is fixed now in SVN, in trunk, branches/py3k, and branches/release25-maint. Thanks again. -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http

[issue3265] Python-2.5.2/Modules/_ctypes/malloc_closure.c:70: error: `MAP_ANONYMOUS' undeclared

2008-08-19 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Here is a patch for Modules/_ctypes/malloc_closure.c that may work (totally untested). The code snippet is copied from Modules/mmapmodule.c. -- keywords: +patch Added file: http://bugs.python.org/file11161/malloc_closure.patch

[issue3265] Python-2.5.2/Modules/_ctypes/malloc_closure.c:70: error: `MAP_ANONYMOUS' undeclared

2008-08-19 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Corrected the patch. Added file: http://bugs.python.org/file11162/malloc_closure.patch ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3265

[issue3265] Python-2.5.2/Modules/_ctypes/malloc_closure.c:70: error: `MAP_ANONYMOUS' undeclared

2008-08-19 Thread Thomas Heller
Changes by Thomas Heller [EMAIL PROTECTED]: Removed file: http://bugs.python.org/file11161/malloc_closure.patch ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3265

[issue3554] ctypes.wstring_at and string_at call Python API without the GIL

2008-08-14 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Good catch! Indeed, when PyString_FromString or PyUnicode_FromWideChar fail, Python crashes with Fatal Python error: PyThreadState_Get: no current thread in a debug build, and an access violation in a release build (tested on Windows). Also

[issue3383] ctypes.util fails to find libc in some environments

2008-08-11 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Well, I have no idea what the standard setup on posix boxes is - should objdump and ldconfig be on $PATH or not? Regarding the groups in the regexp: It is my understanding that the parens do not matter because .group(0) is returned, which

Re: CAB files

2008-08-08 Thread Thomas Heller
Virgil Stokes schrieb: I would appreciate python code for creating *.cab files. --V. Stokes Here is some code that I have still laying around. It has never been used in production and I do not know what you can do with the cab files it creates, but I have been able to create a cab and open

[issue2470] Need fixer for dl (removed) - ctypes module

2008-08-07 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: I can review and try out the fixer if someone provides a patch. OTOH I have never used the dl module. Note that dl exposed a lot of RTLD_ constants that ctypes does not yet, so there should be a patch for ctypes also

Re: ctypes and how to copy data passed to callback

2008-07-28 Thread Thomas Heller
waldek schrieb: Hi, I'm trying to handle data passed to Py Callback which is called from C dll. Callback passes data to another thread using Queue module and there the data are printed out. If data is printed out in a callback itself it's ok. If I put on queue and next get from queue

Re: ctypes and reading value under pointer passed as param of a callback

2008-07-24 Thread Thomas Heller
waldek schrieb: Hi, I'm using C dll with py module and wanna read value (buffer of bytes) returned in py callback as parameter passed to dll function. The callback receives a pointer instance. You can dereference the pointer to read individual bytes in this way: print data[0], data[5],

Re: Working with ctypes and char** data type

2008-07-24 Thread Thomas Heller
Philluminati schrieb: I'm a bit of a python newbie and I need to wrap a C library. I can initialise the library using CDLL('mcclient.so') and I can call functions correctly inside the library but I need to invoke one function which has this function definition: char ** CAPAPI

Re: python.exe crash and ctypes use

2008-07-23 Thread Thomas Heller
waldek schrieb: Hi, I have module A.py and B.dll which exports C functions by cdecl_ In A.py I pass callback (py callable) to dll. Next, thread inside dll simply calls my callback (in a loop). After few secs I got crash of python.exe. How to debug it? I'm using winxp and py 2.5.2

[issue3258] ctypes assertion failure in trunk

2008-07-15 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Thanks for the heads up. Fixed in trunk (rev 64971) and py3k (rev 64972). I used B (pointer to bytes) as the format string for pointer to incomplete structure, not P. -- resolution: - fixed status: open - closed

[issue3313] dlopen() error with no error message from dlerror()

2008-07-15 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: I can confirm the problem on ubuntu linux. -- assignee: - theller nosy: +theller ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3313

Re: Calling pcre with ctypes

2008-06-18 Thread Thomas Heller
moreati schrieb: Recently I discovered the re module doesn't support POSIX character classes: Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2 Type help, copyright, credits or license for more information. import re r =

[issue3125] test_multiprocessing causes test_ctypes to fail

2008-06-18 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: roudkerk schrieb: roudkerk [EMAIL PROTECTED] added the comment: This patch to sharedctypes should fix the problem by adding a __reduce_ex__() method to a shared ctype object instead of using copy_reg. I can confirm that the patch fixes

[issue3124] test_multiprocessing segfaults on Windows

2008-06-16 Thread Thomas Heller
New submission from Thomas Heller [EMAIL PROTECTED]: When Python shuts down after running test_multiprocessing on Windows, a segfault occurs (this is with a debug build from trunk): python26_d.dll!_Py_ForgetReference(_object * op=0x012de740) Line 2023 + 0xf bytes C

[issue3125] test_multiprocessing causes test_ctypes to fail

2008-06-16 Thread Thomas Heller
New submission from Thomas Heller [EMAIL PROTECTED]: test_ctypes, when run after testmultiprocessing, fails: ... == ERROR: test_simple (ctypes.test.test_pickling.PickleTest

[issue3124] test_multiprocessing segfaults on Windows

2008-06-16 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Yes, the patch weakref_cycle.patch from #3100 fixes the problem. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3124

[issue3125] test_multiprocessing causes test_ctypes to fail

2008-06-16 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: IMO this problem occurs because multiprocessing registers pickling support for ctypes, but the ctypes in trunk already has support for pickling. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org

[issue3125] test_multiprocessing causes test_ctypes to fail

2008-06-16 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Adam Olsen schrieb: Thomas, do you have a specific command to reproduce this? It runs fine if I do ./python -m test.regrtest -v test_multiprocessing test_ctypes. That's with amaury's patch from 3100 applied. It seems the failure only

[issue3125] test_multiprocessing causes test_ctypes to fail

2008-06-16 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Adam Olsen [EMAIL PROTECTED] added the comment: I see no common symbols between #3102 and #3092, so unless I missed something, they shouldn't be involved. I second the notion that multiprocessing's use of pickle is the triggering factor

[issue3124] test_multiprocessing segfaults on Windows

2008-06-16 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Thomas Heller [EMAIL PROTECTED] added the comment: Yes, the patch weakref_cycle.patch from #3100 fixes the problem. BTW: I also get a segfault on Linux, which is fixed by this patch. ___ Python tracker

Re: Instructions on how to build py2exe 0.6.8 (or an installer would be nice, too!)

2008-06-10 Thread Thomas Heller
[EMAIL PROTECTED] schrieb: Hello, I'm trying to build an executable with py2exe, but unfortunately the version I have is 0.6.6, which has a rather annoying bug that doesn't let you rename the executable file if you bundle everything in a single executable. It seems fairly unacceptable to

[issue1798] Add ctypes calling convention that allows safe access of errno

2008-06-06 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: A different patch but implementing the same functionality was now committed as trunk rev 63977. -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http

[issue2936] ctypes.util.find_library() doesn't consult LD_LIBRARY_PATH

2008-06-02 Thread Thomas Heller
Changes by Thomas Heller [EMAIL PROTECTED]: -- resolution: - invalid status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue2936

[issue3030] compiler warning on HP-UX

2008-06-02 Thread Thomas Heller
New submission from Thomas Heller [EMAIL PROTECTED]: On HP-UX, there is a compiler warning about _POSIX_C_SOURCE redefined: bash-2.04$ make gcc -pthread -c -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE -o Modules

[issue1798] Add ctypes calling convention that allows safe access of errno

2008-05-30 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Here is a patch implementing the plan. This text could serve as a start for the documentation, but it also describes the current implementation. Usage recipes should probably be added: /* ctypes maintains a module-global, but thread-local

[issue1798] Add ctypes calling convention that allows safe access of errno

2008-05-30 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Thomas Heller schrieb: Here is a patch implementing the plan. ctypes-errno-3.patch, in case of doubt. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1798

[issue2936] ctypes.util.find_library() doesn't consult LD_LIBRARY_PATH

2008-05-30 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: The question is, which linker? I think it should be ld.so, which links on demand, and does pay attention to LD_LIBRARY_PATH. I'm not sure what the point of find_library() is, otherwise. The best explanation is in the python docs: http

[issue2936] ctypes.util.find_library() doesn't consult LD_LIBRARY_PATH

2008-05-29 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: To be honest, I do not understand this request and the discussion. ctypes.util.find_library(), as dcumented, is supposed to simulate what the linker does: find the name of a shared library. For example, it returns 'libc.so.6' when called

[issue1798] Add ctypes calling convention that allows safe access of errno

2008-05-29 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: Ok, here is the plan (basically Armin's proposal): ctypes maintains a gloabl, but thread-local, variable that contains an error number; called 'ctypes_errno' for this discussion. ctypes.set_errno(value) copies 'value' into ctypes_errno

[issue1779233] PyThreadState_SetAsyncExc and the main thread

2008-05-29 Thread Thomas Heller
Changes by Thomas Heller [EMAIL PROTECTED]: -- assignee: theller - ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1779233 ___ ___ Python-bugs-list

[issue1797] ctypes function pointer enhancements

2008-05-29 Thread Thomas Heller
Changes by Thomas Heller [EMAIL PROTECTED]: ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1797 ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue1797] ctypes function pointer enhancements

2008-05-29 Thread Thomas Heller
Thomas Heller [EMAIL PROTECTED] added the comment: NULL function pointers are have a boolean False value now; svn rev 63792 (trunk) and rev 63793 (py3k). ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue1797

<    1   2   3   4   5   6   7   8   >