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/config.py (+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: mp+251667@code.launchpad.net

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
=== modified file 'src/mailman/config/config.py'
--- src/mailman/config/config.py 2015-01-06 02:12:52 +0000
+++ src/mailman/config/config.py 2015-03-03 22:26:47 +0000
@@ -135,7 +135,7 @@
135 def _expand_paths(self):135 def _expand_paths(self):
136 """Expand all configuration paths."""136 """Expand all configuration paths."""
137 # Set up directories.137 # Set up directories.
138 bin_dir = os.path.abspath(os.path.dirname(sys.executable))138 bin_dir = os.path.abspath(sys.path[0])
139 # Now that we've loaded all the configuration files we're going to139 # Now that we've loaded all the configuration files we're going to
140 # load, set up some useful directories based on the settings in the140 # load, set up some useful directories based on the settings in the
141 # configuration file.141 # configuration file.