zsquareplusc/mpy-repl-tool

FUSE: Renaming doesn't

smurfix opened this issue · 1 comments

/mnt/py$ touch x
/mnt/py$ mv x y
mv: cannot move 'x' to a subdirectory of itself, 'y'
/mnt/py$ 

results in:

Uncaught exception from FUSE operation rename, returning errno.EINVAL.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/fusepy.py", line 734, in _wrapper
    return func(*args, **kwargs) or 0
  File "/usr/lib/python3/dist-packages/fusepy.py", line 805, in rename
    return self.operations('rename', old.decode(self.encoding),
  File "/usr/lib/python3/dist-packages/fusepy.py", line 1076, in __call__
    return getattr(self, op)(*args)
  File "/home/smurf/src/mpy-repl-tool/there/fuse_drive.py", line 117, in rename
    return self._remote(old).rename(new)
  File "/home/smurf/src/mpy-repl-tool/there/repl_connection.py", line 410, in rename
    self._repl.evaluate(f'import os; print(os.rename({self.as_posix()!r}, {path_to.as_posix()!r}))')
AttributeError: 'str' object has no attribute 'as_posix'

Client is the current micropython snapshot on ESP32.