derrix060 / onedriveClient

A Microsoft OneDrive and OneDrive for Business client for Linux, written in Python3.
MIT License
65 stars 10 forks source link

Folder delete error #44

Open Subick opened 5 years ago

Subick commented 5 years ago

Hi!

When I try to delete a folder from remote folder on the local machine I get the following error:

Unhandled inotify event Event(wd=4, mask=32768, cookie=0, name='') on local path "/path/to/folder/". Flags: flags.IGNORED.
[2019-01-29 10:52:36,602] ERROR: MainThread: Exception in callback LocalRepositoryWatcher.process_events()
handle: <Handle LocalRepositoryWatcher.process_events()>
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/events.py", line 126, in _run
    self._callback(*self._args)
  File "/usr/local/lib/python3.5/dist-packages/onedriveClient-2.0.1-py3.5.egg/onedrive_client/od_watcher.py", line 451, in process_events
    self.handle_event(ev, flags, move_pairs)
  File "/usr/local/lib/python3.5/dist-packages/onedriveClient-2.0.1-py3.5.egg/onedrive_client/od_watcher.py", line 368, in handle_event
    self.rm_watch(repo, parent_dir + '/' + ev.name)
  File "/usr/local/lib/python3.5/dist-packages/onedriveClient-2.0.1-py3.5.egg/onedrive_client/od_watcher.py", line 73, in rm_watch
    self.notifier.rm_watch(wd)
  File "/usr/local/lib/python3.5/dist-packages/inotify_simple-1.1.7-py3.5.egg/inotify_simple/inotify_simple.py", line 110, in rm_watch
    _libc_call(_libc.inotify_rm_watch, self.fd, wd)
  File "/usr/local/lib/python3.5/dist-packages/inotify_simple-1.1.7-py3.5.egg/inotify_simple/inotify_simple.py", line 68, in _libc_call
    raise OSError(errno, os.strerror(errno))
OSError: [Errno 22] Invalid argument

and the folder is not deleted on the drive.

There are also a lot of keyerror in the other operations, like this:

[2019-01-28 18:15:27,004] ERROR: MainThread: Exception in callback LocalRepositoryWatcher.process_events()
handle: <Handle LocalRepositoryWatcher.process_events()>
Traceback (most recent call last):
  File "/usr/lib/python3.5/asyncio/events.py", line 126, in _run
    self._callback(*self._args)
  File "/usr/local/lib/python3.5/dist-packages/onedriveClient-2.0.1-py3.5.egg/onedrive_client/od_watcher.py", line 451, in process_events
    self.handle_event(ev, flags, move_pairs)
  File "/usr/local/lib/python3.5/dist-packages/onedriveClient-2.0.1-py3.5.egg/onedrive_client/od_watcher.py", line 349, in handle_event
    repo, parent_dir = self.watch_descriptors[ev.wd]
  File "/usr/local/lib/python3.5/dist-packages/bidict-0.13.1-py3.5.egg/bidict/_common.py", line 96, in proxy
    return meth(*args)
KeyError: 5 

But, If I copy or delete a file, it works.

What could be the problem? Thank you.

derrix060 commented 5 years ago

The second issue looks like related with #21. I'll take a look on the first one,

derrix060 commented 5 years ago

Do you have any \ in your path? OSError: [Errno 22] is when the path is not valid.

Can you paste the full path?

Subick commented 5 years ago

Hi!

The drive is mounted here: /opt/cloud_backup_test There is a "test" folder on the drive. When I entered the cloud_backup_test folder and I want to delete test folder with rm -rf test I got the errors above. It works perfectly with a simple file.