Since fcntl.lockf does not work on Windows Subsystem for Linux (WSL), it would be nice to detect the breakage and fallback to fcntl.flock.
Patch posted for review: https://archives.gentoo.org/gentoo-portage-dev/message/560e54db2975aea5ff141f741271716a https://github.com/gentoo/portage/pull/55
This is in the master branch: https://gitweb.gentoo.org/proj/portage.git/commit/?id=5ef5fbaab88de47d4dbab333661d3525261d7633
Fixed in portage-2.3.3.