Skip to content

`fcntl` package only works on Linux/Unix systems

The state/cache file writing utility that I wrote a few months back uses the fcntl package that comes with base Python to handle file locking. It turns out that this package is only available on Unix/Linux systems and that relying on it has broken support for Geomag-Algorithms on Windows. Right now, if a user installs geomag-algorithms in a Windows environment then tries to run anything that relies on Util.py, e.g.: geomag.py, it will halt with a No module named 'fcntl' error.

File locking is fairly important for state/cache files. I found a couple of possible 'fixes' online:

  1. Add in OS-dependent code that uses win32api instead of fcntl if the OS is Windows-based.
  2. Use a third-party package such as portalocker. This would mean that we would have to officially add a new package requirement for users.
Edited by Geels, Brendan Ryan