code: def __format_path(self, path):
          
          # Unicode strings are converted back to strings, because it seems
          # that inotify_add_watch from ctypes does not work well when
          # it receives an ctypes.create_unicode_buffer instance as argument.
          # Therefore even wd are indexed with bytes string and not with
          # unicode paths.
          if isinstance(path, unicode):
              path = path.encode(sys.getfilesystemencoding())
          return os.path.normpath(path)
docs: Format path to its internal (stored in watch manager) representation.