On Tue, Jan 22, 2013 at 2:09 PM, Xiaofan Chen <xiaof...@gmail.com> wrote:
> So it seems to me maybe the DLL finding method in Python 3.3
> is a bit different.
>
> Google seems to suggest this is a Python 3.3 bug.
> http://bugs.python.org/issue16283
> Title:  ctypes.util.find_library does not find all DLLs anymore
> Type:   behavior        Stage:
> Components:     ctypes  Versions:       Python 3.3
>

The work-around seems to speel out the full name ".dll".
Maybe this can be done in pyusb.

In the bug report, there is a test script attached.

http://bugs.python.org/file27618/ct_test.py

import sys
import os
import ctypes.util

lookup_path = "C:\\Windows\\system32"
dll_file = os.path.join(lookup_path, "OpenAL32.dll")

print("Python build: %s" % sys.version)

print("Path '%s' exists in $PATH: %s" % (lookup_path, lookup_path in
os.environ["PATH"].split(os.pathsep)))
print("File '%s' exists: %s" % (dll_file, os.path.exists(dll_file) and
os.path.isfile(dll_file)))

print("ctypes says for '%s': %s" % ("OpenAL32.dll",
ctypes.util.find_library("OpenAL32.dll")))
  --- this works.
print("ctypes says for '%s': %s" % ("OpenAL32",
ctypes.util.find_library("OpenAL32")))
  --- this does not work.

-- 
Xiaofan

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
pyusb-users mailing list
pyusb-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pyusb-users

Reply via email to