barneygale / mark2

minecraft server wrapper, written in python with twisted
Other
105 stars 27 forks source link

Fixed bug where no default editor broke CommandConfig #115

Closed skovhus closed 9 years ago

skovhus commented 10 years ago

Just a small bug fix. Replaced the rather unknown fallback editor "editor" with good old "nano".

gpmidi commented 10 years ago

This fixes an issue that a friend was having where he would get an OSError because his base OS, CentOS 6 from a minimal install, doesn't have 'editor' installed.

This pull request will resolve this issue for CentOS/RHEL users as well as help those users who aren't familiar with VIM.

Traceback (most recent call last):
  File "/usr/bin/mark2", line 6, in <module>
    sys.exit(main())
  File "/usr/mark2/mk2/launcher.py", line 605, in main
    command.start()
  File "/usr/mark2/mk2/launcher.py", line 126, in start
    self.run()
  File "/usr/mark2/mk2/launcher.py", line 479, in run
    subprocess.call([editor, path_tmp])
  File "/usr/lib64/python2.6/subprocess.py", line 478, in call
    p = Popen(*popenargs, **kwargs)
  File "/usr/lib64/python2.6/subprocess.py", line 642, in __init__
    errread, errwrite)
  File "/usr/lib64/python2.6/subprocess.py", line 1234, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
prophile commented 10 years ago

It strikes me that assuming nano is installed is as big an assumption as assuming editor is installed.

Perhaps vi as an alternative, since its installation is required by POSIX?

gpmidi commented 10 years ago

Very good point. VI probably is the safest option.

jwflory commented 10 years ago

I can confirm that I am also having this issue. This would solve many of the frustrations in getting it working on RHEL-based distros.

Also worth noting, as told to me by the #mcdevs IRC channel, my CentOS box doesn't have 'vi' installed as a default in CentOS 6.5. I only have 'vim', which is more or less the same thing, but just the "improved" version. Found in /usr/bin/vim