Skip to content

Commit 02283fd

Browse files
committed
Encode the library paths with the filesystem encoding for compatibility with Py3.
1 parent 664903a commit 02283fd

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

libloader/libloader.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
class LibraryLoadError(OSError): pass
3030

3131
def load_library(library, x86_path='.', x64_path='.', *args, **kwargs):
32+
library = library.encode(sys.getfilesystemencoding())
33+
x86_path = x86_path.encode(sys.getfilesystemencoding())
34+
x64_path = x64_path.encode(sys.getfilesystemencoding())
3235
lib = find_library_path(library, x86_path=x86_path, x64_path=x64_path)
3336
loaded = _do_load(lib, *args, **kwargs)
3437
if loaded is not None:

0 commit comments

Comments
 (0)