Commit 48de9f65 authored by Daniel Stan's avatar Daniel Stan

chgpass: getattr(sys.stdout, 'encoding', 'UTF-8')

Safer
parent f023c5b0
......@@ -25,7 +25,7 @@ import lc_ldap.attributs
import lc_ldap.objets
import smtplib
encoding = sys.stdout.encoding or "UTF-8"
encoding = getattr(sys.stdout, 'encoding', "UTF-8")
current_user = os.getenv("SUDO_USER") or os.getenv("USER") or os.getenv("LOGNAME") or getpass.getuser()
def check_password(password, no_cracklib=False, dialog=False):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment