[Git][NTPsec/ntpsec][master] Changed ntpmon to detect the unicode-refusing encoding and compensate

Ian Bruene gitlab at mg.gitlab.com
Fri Sep 29 02:47:11 UTC 2017


Ian Bruene pushed to branch master at NTPsec / ntpsec


Commits:
7891eea1 by Ian Bruene at 2017-09-28T21:45:36-05:00
Changed ntpmon to detect the unicode-refusing encoding and compensate

- - - - -


2 changed files:

- ntpclients/ntpmon
- pylib/util.py


Changes:

=====================================
ntpclients/ntpmon
=====================================
--- a/ntpclients/ntpmon
+++ b/ntpclients/ntpmon
@@ -45,6 +45,11 @@ except ImportError as e:
     sys.exit(1)
 
 
+# LANG=C or LANG=POSIX refuse unicode when combined with curses
+if "ANSI_X3.4-1968" == sys.stdout.encoding:
+    ntp.util.deunicode_units()
+
+
 try:
     import locale
 except ImportError as e:


=====================================
pylib/util.py
=====================================
--- a/pylib/util.py
+++ b/pylib/util.py
@@ -18,6 +18,9 @@ import ntp.magic
 import ntp.control
 
 
+print(sys.stdout.encoding)
+
+
 if "get_terminal_size" not in dir(shutil):
     # used by termsize() on python 2.x systems
     import fcntl



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/7891eea18b68b9704c4d0ab6f7eee9d9b131397d

---
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/7891eea18b68b9704c4d0ab6f7eee9d9b131397d
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170929/1fdf34a7/attachment.html>


More information about the vc mailing list