As per the title, the commented out code works, while using Pathlib gives me an Illegal Instruction 4. Printing the paths to terminal shows they're set correctly, and commenting out the observer.schedule line runs the program with no errors.
class ObserverLoop:
def __init__(self):
self.folder = Path("~/Desktop")
print(self.folder.expanduser())
# self.working_path = os.path.abspath(os.path.expanduser("~/" + "/Desktop/"))
self.working_path = self.folder.expanduser()
print(self.working_path)
self.event_handler = MonitorFolderChanges(self.working_path)
def start_loop(self):
tf.key = secrets.api_key
observer = Observer()
observer.schedule(self.event_handler, self.working_path, recursive=False)
observer.start()
try:
while observer.is_alive():
observer.join(1)
except KeyboardInterrupt:
observer.stop()
observer.join()
Which version of watchdog?
The latest version 0.10.2 I believe.
Could you try with the 0.10.3, the current latest. It contains a fix to support path-like objects (see https://github.com/gorakhargosh/watchdog/releases/tag/v0.10.3).
Thanks for the solution, and sorry for the delay in replying. The main reason for the issue is that I wasn't offered the latest version when trying to brew upgrade
.