whole-tale / wt_home_dirs

0 stars 1 forks source link

Move on objects with spaces in names fails #7

Closed Xarthisius closed 6 years ago

Xarthisius commented 6 years ago

Steps to reproduce:

  1. Create folder "test folder"
  2. Try to rename it to "test folder 2" using Girder UI

Result:

WARNING:girder:Exception caught while handling event <girder.events.Event object at 0x7f34d2e3e6a8>: Specified folder does not exist: /user/kowalikk/Home/test with space
ERROR:girder:500 Error
Traceback (most recent call last):
  File "/girder/girder/api/rest.py", line 620, in endpointDecorator
    val = fun(self, args, kwargs)
  File "/girder/girder/api/rest.py", line 1208, in PUT
    return self.handleRoute('PUT', path, params)
  File "/girder/girder/api/rest.py", line 947, in handleRoute
    val = handler(**kwargs)
  File "/girder/girder/api/access.py", line 63, in wrapped
    return fun(*args, **kwargs)
  File "/girder/girder/api/rest.py", line 467, in wrapped
    val = fun(*args, **kwargs)
  File "/girder/girder/api/describe.py", line 702, in wrapped
    return fun(*args, **kwargs)
  File "/girder/girder/api/v1/folder.py", line 172, in updateFolder
    folder = self._model.updateFolder(folder)
  File "/girder/girder/models/folder.py", line 556, in updateFolder
    return self.save(folder)
  File "/girder/girder/models/model_base.py", line 421, in save
    event = events.trigger('model.%s.save' % self.name, document)
  File "/girder/girder/events.py", line 310, in trigger
    handler['handler'](e)
  File "/girder/plugins/wt_home_dir/server/__init__.py", line 78, in handler
    h.run(event, path, e.pathMapper, provider)
  File "/girder/plugins/wt_home_dir/server/lib/EventHandlers.py", line 106, in run
    self.renameFolder(storedFolder, folder['name'], pathMapper, provider)
  File "/girder/plugins/wt_home_dir/server/lib/EventHandlers.py", line 136, in renameFolder
    self.assertIsValidFolder(res, girderSrcPath)
  File "/girder/plugins/wt_home_dir/server/lib/EventHandlers.py", line 118, in assertIsValidFolder
    raise IOError('Specified folder does not exist: %s' % path)
OSError: Specified folder does not exist: /user/kowalikk/Home/test with space
Additional info:
  Request URL: PUT https://girder.stage.wholetale.org/api/v1/folder/5b19741bc0bcc3000152aaf9
  Query string: 
  Remote IP: 10.0.0.2

On disk it changes name properly.