I'm seeing an issue where I can't use named pipes created in a Linux program (Python3) in my Windows application that is running under Wine. The windows application is written in Python2.7.
I reproduced this same error in a basic Wine prefix, with the steps below. I'd appreciate any input if i'm doing anything wrong here, or how I can debug this issue further.
Setup: Ubuntu 20.04 server, Wine version: wine32=5.0-3ubuntu1
WINEARCH=win32 (needed by our application), WINEPREFIX=/home/user/.prefix
Wine prefix setup:
- install Python2.7.18 using msiexec
- install pywin32 in Python2.7.18 using pip.
Linux Python3 app:
Code: Select all
import os
import fcntl
path = "/home/user/.prefix/drive_c/pipe"
os.mkfifo(path)
writeHandler = open(path, 'w') # this operation will block, so the line below is never reached.
fcntl.fcntl(writeHandler, fcntl.F_SETFL, os.O_NONBLOCK)
Code: Select all
import win32file, win32pipe
path="C:\\pipe"
handler=win32file.CreateFile(path, win32file.GENERIC_READ, 0, None, win32file.OPEN_EXISTING, 0, None)
buffer, bytesToRead, result = win32pipe.PeekNamedPipe(handler, 0)
if bytesToRead:
returnValue, data = win32file.ReadFile(handler, bytesToRead, None)
Code: Select all
pywintypes.error: (50, 'PeekNamedPipe', 'Request not supported.')