diff --git a/mugshot/MugshotWindow.py b/mugshot/MugshotWindow.py index 9f5a035..7579986 100644 --- a/mugshot/MugshotWindow.py +++ b/mugshot/MugshotWindow.py @@ -520,7 +520,8 @@ class MugshotWindow(Window): # Full name can only be modified by root. Try using sudo to modify. logger.debug('Attempting to set fullname with sudo chfn') # Force the C language for guaranteed english strings in the script. - child = pexpect.spawn('LANG=C %s %s %s' % (sudo, chfn, username)) + child = pexpect.spawn('%s %s %s' % (sudo, chfn, username), + env={"LANG": "C"}) child.timeout = 5 try: child.expect([".*ssword.*", pexpect.EOF]) @@ -541,7 +542,7 @@ class MugshotWindow(Window): return_codes.append(child.exitstatus) logger.debug('Attempting to set user details with chfn') - child = pexpect.spawn('LANG=C %s' % chfn) + child = pexpect.spawn(chfn, env={"LANG": "C"}) child.timeout = 5 try: child.expect([".*ssword.*", pexpect.EOF]) diff --git a/mugshot_lib/SudoDialog.py b/mugshot_lib/SudoDialog.py index 5f9c113..3de0bf6 100644 --- a/mugshot_lib/SudoDialog.py +++ b/mugshot_lib/SudoDialog.py @@ -216,7 +216,7 @@ class SudoDialog(Gtk.MessageDialog): Return True if successful. ''' # Set the pexpect variables and spawn the process. - child = pexpect.spawn('LANG=C sudo /bin/true') + child = pexpect.spawn('sudo /bin/true', env={"LANG": "C"}) child.timeout = 1 try: # Check for password prompt or program exit.