ctypes error on Windows

M

Mike Hostetler

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?
 
F

Fredrik Lundh

Mike said:
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:

</F>
 
F

Fredrik Lundh

Fredrik said:
typing the following into the Python interpreter might give you some
more clues:

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>
 
T

Thomas Heller

Fredrik said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top