-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug when using CLibrary() on a Windows Path #42
Comments
The code handling the library loading is here https://github.com/MatthieuDartiailh/pyclibrary/blob/master/pyclibrary/c_library.py#L60 You could as a workaround use |
Thank you for your answer! Indeed, I am now using os.path.join() instead of pathlib's paths, and it works perfectly. Specifically:
where Out of curiosity, are you familiar with the pathlib module? I learned recently that it takes care of all that kind of headache with a lot of flexibility, and quickly became my go-to module for file management. |
I do know about pathlib but never used it. I am usually happy with os.path. I guess we could support path-like object, is it something you could contribute ? |
Hi Matthieu,
Thank you for this fantastic module. I think it made a task I had to do something in the lines of 4 times faster. Unfortunately, as thankful as I am for this module, I'm not here for that, but to report a bug.
I have noticed that, when using the function CLibrary on Windows, pyclibrary only manages to locate the DLL in a different folder than the cwd if the path provided is a string with only backward slashes (Windows style). I have tried many variations: string with a forward slash, many variations of the libpath.Path and the libpath.PurePath submodules, with no success. I ended up using libpath.Path and convert it to a string with the as_posix() argument, then replacing the forward slashes with backward slashes if we're on Windows... Which kinda works but, as you guess, is not clean.
Anyway, I would like to thank you again for this fantastic work. Let me know if you need any additional information.
The text was updated successfully, but these errors were encountered: