aleix's blog

ropemacs and remote files (fuse)

16 November 2010 8:27 PM (emacs | python)

This morning I needed to edit some python scripts from a local server at work and, as always, used the TRAMP Emacs mode, but immediately found a problem. A few months ago I installed the great python refactoring library rope and its Emacs mode ropemacs. It comes out that ropemacs asks you for the location of your rope project if it cannot find it (this always happens the first time you start a project).

TRAMP URLs look like this:

/ssh:user@server:/path

So, you can now imagine what happens when Emacs gives an URL like this to rope (which is a python library and doesn't know anything about TRAMP URLs) as if it was a local file name...

Traceback (most recent call last):
  ...
  ...
  File "/usr/lib/python2.6/.../ropemode/interface.py", line 88, in open_project
    self.project = rope.base.project.Project(root)
  File "/usr/lib/python2.6/.../rope/base/project.py", line 134, in __init__
    os.mkdir(self._address)
OSError: [Errno 2] No such file or directory: '/ssh:user@server:/path'

The worst is that you are continuously being asked by Emacs to enter a valid rope project location.

The solution? Simply use the FUSE SSH Filesystem.

$ sudo apt-get install sshfs
$ sshfs user@server:path mountpoint

FUSE stands for Filesystem in Userspace. With FUSE you will end up editing remote files as if they were in your computer and the great thing is that you don't need root access, so any user can mount a FUSE filesystem.

Update 2010/11/17: FUSE mounted directory can be unmounted with:

$ fusermount -u mountpoint

No responses

Leave a Reply