Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > ctypes error on Windows

Reply
Thread Tools

ctypes error on Windows

 
 
Mike Hostetler
Guest
Posts: n/a
 
      09-05-2008
I'm working on a script with the most excellent uTibyLib library. The script works just fine on Mac, but on Windows I get this:

File "findtables.py", line 82, in cleanHTML
return str(tidy.parseString(decentDoc))
File "c:\Python24\Lib\site-packages\tidy\lib.py", line 207, in parseString
doc = self._create(**kwargs)
File "c:\Python24\Lib\site-packages\tidy\lib.py", line 183, in _create
doc = _Document()
File "c:\Python24\Lib\site-packages\tidy\lib.py", line 135, in __init__
self.cdoc = _tidy.Create()
File "c:\Python24\Lib\site-packages\tidy\lib.py", line 46, in __getattr__
return getattr(self.lib, name)
File "C:\Python24\Lib\site-packages\ctypes\__init__.py", line 353, in __getatt
func = self.__getitem__(name)
File "C:\Python24\Lib\site-packages\ctypes\__init__.py", line 358, in __getite
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'Create' not found


I do have the tidy.dll installed (if I didn't, I couldn't even import the tidy module).

Anyone have any ideas to try?

--
http://www.velocityreviews.com/forums/(E-Mail Removed)
SDF Public Access UNIX System - http://sdf.lonestar.org
 
Reply With Quote
 
 
 
 
Fredrik Lundh
Guest
Posts: n/a
 
      09-05-2008
Mike Hostetler wrote:

> I'm working on a script with the most excellent uTibyLib library. The script works just fine on Mac, but on Windows I get this:
>
> File "findtables.py", line 82, in cleanHTML
> return str(tidy.parseString(decentDoc))
> File "c:\Python24\Lib\site-packages\tidy\lib.py", line 207, in parseString
> doc = self._create(**kwargs)
> File "c:\Python24\Lib\site-packages\tidy\lib.py", line 183, in _create
> doc = _Document()
> File "c:\Python24\Lib\site-packages\tidy\lib.py", line 135, in __init__
> self.cdoc = _tidy.Create()
> File "c:\Python24\Lib\site-packages\tidy\lib.py", line 46, in __getattr__
> return getattr(self.lib, name)
> File "C:\Python24\Lib\site-packages\ctypes\__init__.py", line 353, in __getatt
> func = self.__getitem__(name)
> File "C:\Python24\Lib\site-packages\ctypes\__init__.py", line 358, in __getite
> func = self._FuncPtr((name_or_ordinal, self))
> AttributeError: function 'Create' not found
>
> 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)


</F>

 
Reply With Quote
 
 
 
 
Fredrik Lundh
Guest
Posts: n/a
 
      09-05-2008
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, since ctypes is involved.

have you checked for multiple copies of tidy.dll?

if you have MSVC on your machine, try using "dumpbin /exports" on the
DLL to check that it really exports the symbols the binding expects.

</F>

 
Reply With Quote
 
Thomas Heller
Guest
Posts: n/a
 
      09-05-2008
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, since ctypes is involved.
>
> have you checked for multiple copies of tidy.dll?
>
> if you have MSVC on your machine, try using "dumpbin /exports" on the
> DLL to check that it really exports the symbols the binding expects.
>


Or use dependencywalker (google for it).

Thomas
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
WindowsXP/ CTypes - How to convert ctypes array to a string? dudeja.rajat@gmail.com Python 0 08-19-2008 10:20 AM
ctypes: Problems using Windows-DLL from VB example code Noralf Trønnes Python 4 05-09-2007 06:58 PM
Using ctypes with Windows API to get FileVersion of a file looping Python 0 11-14-2006 11:16 AM
Example Code - Named Pipes (Python 2.4 + ctypes on Windows) Srijit Kumar Bhadra Python 6 03-26-2005 07:21 PM
RE: [ctypes-users] [Ann] ctypes 0.9.0 released Henk Punt Python 0 07-23-2004 10:34 PM



Advertisments