From 2e72cd4b227ba7c40d7da2ff9d1cd7581f368e70 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Fri, 27 Apr 2018 18:35:55 +0800 Subject: [PATCH 1/2] new: pkg: added flake8 configuration. --- setup.cfg | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.cfg b/setup.cfg index 37a3947..847a636 100644 --- a/setup.cfg +++ b/setup.cfg @@ -42,3 +42,9 @@ extra_files = scripts = shyaml + +[flake8] +ignore = E265,W391,E262,E126,E127 +max-line-length = 80 +max-complexity = 15 + From f2fa625340fa9073b564ef9b687054f62be789b3 Mon Sep 17 00:00:00 2001 From: Brian Hasselbeck Date: Thu, 30 Aug 2018 09:39:48 -0400 Subject: [PATCH 2/2] Adds encoding for special characters Enforces UTF-8 changes for special characters in yaml value. Relates to: https://stackoverflow.com/questions/9942594/unicodeencodeerror-ascii-codec-cant-encode-character-u-xa0-in-position-20 --- shyaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shyaml b/shyaml index a03fbf6..674bd17 100755 --- a/shyaml +++ b/shyaml @@ -454,7 +454,7 @@ def main(args): ## pylint: disable=too-many-branches termination = "\0" if action.endswith("-0") else "\n" if action == "get-value": - print(dump(value), end='') + print(dump(value).encode('utf-8'), end='') elif action in ("get-values", "get-values-0"): if isinstance(value, dict): for k, v in value.iteritems():