Merge lp:~sambuddhabasu1/mailman/fix_mailman_run_error into lp:mailman

Proposed by Sambuddha Basu
Status: Merged
Merge reported by: Barry Warsaw
Merged at revision: not available
Proposed branch: lp:~sambuddhabasu1/mailman/fix_mailman_run_error
Merge into: lp:mailman
Diff against target: 12 lines (+1/-1)
1 file modified
src/mailman/config/ (+1/-1)
To merge this branch: bzr merge lp:~sambuddhabasu1/mailman/fix_mailman_run_error
Reviewer Review Type Date Requested Status
Barry Warsaw Needs Fixing
Review via email:

Description of the change

The error message that showed up on running 'mailman start' was:

/usr/bin/python3: can't open file '/usr/bin/master': [Errno 2] No such file or directory

This was caused as the file was searching for '/usr/bin/master' which is not present. Rather it should search for '/usr/local/bin/master'.

To post a comment you must log in.
Revision history for this message
Barry Warsaw (barry) wrote :

You might be right that sys.executable isn't the right thing to use, but I also don't think sys.path[0] is right either. Try running the test suite with `tox` to see the problems. Maybe using the directory of sys.argv[0] is better?

review: Needs Fixing
Revision history for this message
Barry Warsaw (barry) wrote :

The reason this doesn't work is because the test suite will fail. However, I've adapted this and will apply it to the release-3.0 and master git branches.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/mailman/config/'
2--- src/mailman/config/ 2015-01-06 02:12:52 +0000
3+++ src/mailman/config/ 2015-03-03 22:26:47 +0000
4@@ -135,7 +135,7 @@
5 def _expand_paths(self):
6 """Expand all configuration paths."""
7 # Set up directories.
8- bin_dir = os.path.abspath(os.path.dirname(sys.executable))
9+ bin_dir = os.path.abspath(sys.path[0])
10 # Now that we've loaded all the configuration files we're going to
11 # load, set up some useful directories based on the settings in the
12 # configuration file.