zsquareplusc / mpy-repl-tool

Yet an other tool to transfer files, execute files and so on via the Python prompt, used for MicroPython
Other
19 stars 5 forks source link

FUSE: Renaming doesn't #19

Open smurfix opened 3 years ago

smurfix commented 3 years ago
/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'
smurfix commented 3 years ago

Client is the current micropython snapshot on ESP32.