• relative
  • absolute
  • cwd
  • open

The common pattern is that people expect open() with a relative path to work when opening a file that is located next to the module source file, because the current working directory is not matching the module directory.

The solution is to create an absolute path to the directory of the module using the the module __file__ value, then constructing a path to the file to be opened from that path.