Seems like UnlockFileEx has not been completely fixed after resolving issue https://sourceforge.net/p/pywin32/bugs/561/
The win32 api for byte range locks, UnlockFileEx etc specifies unsigned (DWORD) arguments for the length of the lock. The Pywin32 api uses signed int, making it impossible to request some locks that would be allowed using the native wine32 api.