diff options
Diffstat (limited to 'ipaserver')
-rw-r--r-- | ipaserver/install/bindinstance.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py index f02fe8647..547cf19ee 100644 --- a/ipaserver/install/bindinstance.py +++ b/ipaserver/install/bindinstance.py @@ -405,7 +405,10 @@ def zonemgr_callback(option, opt_str, value, parser): # validate the value first try: # IDNA support requires unicode - value = value.decode(getattr(sys.stdin, 'encoding', 'utf-8')) + encoding = getattr(sys.stdin, 'encoding', None) + if encoding is None: + encoding = 'utf-8' + value = value.decode(encoding) validate_zonemgr_str(value) except ValueError, e: parser.error("invalid zonemgr: " + unicode(e)) |