我们在项目中使用PyFilesystem。它在Windows7 x64上运行良好,但在Windows7 x32上会引发一个异常:
Exception in thread Thread-28:
Traceback (most recent call last):
File "C:\Python34\lib\threading.py", line 911, in _bootstrap_inner
self.run()
File "C:\environment\lib\site-packages\fs\osfs\watch_win32.py", line 365, in run
-1)
ctypes.ArgumentError: argument 4: <class 'TypeError'>: expected LP_OVERLAPPED instance instead of pointer to OVERLAPPED发生异常的代码:
...
overlapped = OVERLAPPED()
while not self.closed:
try:
GetQueuedCompletionStatus(self._iocp,
ctypes.byref(nbytes),
ctypes.byref(iocpkey),
ctypes.byref(overlapped),
-1)
except WindowsError:
traceback.print_exc()
...如果有任何帮助,我将不胜感激。
发布于 2017-04-20 23:56:45
我也遇到了同样的问题,这是因为在这种情况下,watchdog中有另一个模块为相同的函数定义了参数。我建议把GetQueuedCompletionStatus.argtypes打印出来。这将给你一个提示,哪个模块的PyFilesystem是冲突的。
在这种情况下我的输出是:
(<class 'ctypes.c_void_p'>, <class 'ctypes.c_void_p'>, <class 'ctypes.c_void_p'>, <class 'watchdog.observers.winapi.LP_OVERLAPPED'>, <class 'ctypes.c_ulong'>)
第四个参数指向watchdog.observers.winapi.LP_OVERLAPPED,这将您带到您的问题所在。
https://stackoverflow.com/questions/42394255
复制相似问题