summaryrefslogtreecommitdiff
path: root/bin
diff options
authorSylvain Pineau <sylvain.pineau@canonical.com>2018-05-04 14:19:25 +0200
committerSylvain Pineau <sylvain.pineau@canonical.com>2018-05-04 14:19:25 +0200
commit8611723721f50e96b6526a17082735b82c96f69d (patch)
tree135259271c4dde9a00bebb126189da26a60ea85b /bin
parent91e32f73db31101131c2ef8d1bf80701a01fbb8b (diff)
pm_test: Unset LD_LIBRARY_PATH, PYTHONPATH and PYTHONHOME to start system terminal
gnome-terminal is using a python3 starter script that has to load the system wide modules/library to work properly. That's not the case in pm_test is started from a checkbox snap where all those env var point to paths inside the snap. This patch unset them to ensure gnome-terminal (via x-terminal-emulator) starts with the right env. For the record the error was: ImportError: module encoding not found
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pm_test2
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/pm_test b/bin/pm_test
index d1bd3b1..bf4f436 100755
--- a/bin/pm_test
+++ b/bin/pm_test
@@ -206,6 +206,8 @@ class PowerManagementOperation():
MessageDialog(title, message).run()
if self.args.checkbox_respawn_cmd:
subprocess.run(
+ r'unset LD_LIBRARY_PATH;'
+ r'unset PYTHONPATH; unset PYTHONHOME;'
r'DISPLAY=:0 x-terminal-emulator -e "sudo -u '
r'{} bash -c \"source {}; exec bash\""'.format(
self.user, self.args.checkbox_respawn_cmd), shell=True)