[MERGE] Improve error handling in msgeditor._run_editor.
John Arbash Meinel
john at arbash-meinel.com
Thu Dec 18 06:14:41 GMT 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Andrew Bennetts wrote:
> A user on IRC just reported trouble using “bzr commit” without -m. It
> turned out that somehow they had this line in their bazaar.conf:
>
> editor = ""
>
> There are two issues here. First is that executing "" causes EACCES, and
> _run_editor wasn't catching that. The second is that the error reporting
> was very unhelpful in this case; it didn't report which command bzr was
> trying to run, or why.
>
> So this patch fixes both. It catches EACCES in _run_editor (which could
> happen if the editor isn't executable or readable as well), and it also
> emits a warning to the user if a configured editor is not exectuable, on the
> basis that that means their configuration/environment is probably not sane.
> It *doesn't* emit that warning when trying the hardcoded guesses
> (notepad.exe, /usr/bin/editor, etc), only for user-controllable values.
>
> I'm interested in feedback about emitting a warning in this situation. On
> one hand, it would have made this problem easier to diagnose — the user on
> IRC today probably wouldn't have needed to come to #bzr for help if we
> emitted it. But maybe it's too chatty to complain if a user's environment
> is slightly broken? I think probably this change is fine (it's usually not
> hard to set $EDITOR correctly), but I know extra output can irritate people,
> so let me know.
>
> -Andrew.
BB:approve
Well, at least the updated version.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAklJ6lEACgkQJdeBCYSNAAPZdwCePITtMN26m3X7zApvu7CSU++B
9mgAoNFQf7MNvbQneSFELc7BgnQofkoP
=p1HK
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list