diff options
author | Casey Deccio <casey@deccio.net> | 2015-08-26 22:56:31 +0300 |
---|---|---|
committer | Casey Deccio <casey@deccio.net> | 2015-08-26 22:56:31 +0300 |
commit | 4b06c85ee2dc13ae0f324ee19f27932bfe251904 (patch) | |
tree | 0fb0ebe8e0806d90966f4dafc6efd8eb2f5ee3f5 /bin | |
parent | c61205c9e004d10c7040d653ce6f778d09f8d5d2 (diff) |
Properly decode names from command-line
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/dnsget | 4 | ||||
-rwxr-xr-x | bin/dnsgrok | 4 | ||||
-rwxr-xr-x | bin/dnsviz | 4 |
3 files changed, 9 insertions, 3 deletions
@@ -597,7 +597,9 @@ def main(): names.append(name) f.close() else: - if not args: + if args: + args = map(lambda x: x.decode(sys.getfilesystemencoding()), args) + else: try: args = analysis_structured['_meta._dnsviz.']['names'] except KeyError: diff --git a/bin/dnsgrok b/bin/dnsgrok index 3edcc85..8e4edd1 100755 --- a/bin/dnsgrok +++ b/bin/dnsgrok @@ -163,7 +163,9 @@ def main(): names.append(name) f.close() else: - if not args: + if args: + args = map(lambda x: x.decode(sys.getfilesystemencoding()), args) + else: try: args = analysis_structured['_meta._dnsviz.']['names'] except KeyError: @@ -396,7 +396,9 @@ def main(): names.append(name) f.close() else: - if not args: + if args: + args = map(lambda x: x.decode(sys.getfilesystemencoding()), args) + else: try: args = analysis_structured['_meta._dnsviz.']['names'] except KeyError: |