Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
Resolve scan issues with python 3.6. Closes #97.
Browse files Browse the repository at this point in the history
  • Loading branch information
chambridge committed Aug 15, 2017
1 parent e8f9fbe commit 506f782
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rho/scancommand.py
Expand Up @@ -24,7 +24,7 @@
from rho import utilities
from rho.clicommand import CliCommand
from rho.vault import get_vault_and_password
from rho.utilities import multi_arg, _read_in_file, str_to_ascii
from rho.utilities import multi_arg, _read_in_file, str_to_ascii, iteritems
from rho.translation import _


Expand Down Expand Up @@ -136,7 +136,7 @@ def _create_hosts_auths_file(success_map, profile):
'---' \
'---' \
'---\n'
for host, line in success_map.iteritems():
for host, line in iteritems(success_map):
string_to_write += host + '\n----------------------\n'
for auth in line:
string_to_write += ', '.join(auth[1:3]) + ', ********, ' +\
Expand Down
5 changes: 4 additions & 1 deletion rho/utilities.py
Expand Up @@ -210,7 +210,10 @@ def str_to_ascii(in_string):
:param in_string: input string to convert to ascii
:returns: ASCII encoded string
"""
return str.encode(in_string, 'ascii')
if sys.version_info.major == 2:
return in_string.decode('utf-8').encode('ascii')

return in_string


def iteritems(dictionary):
Expand Down

0 comments on commit 506f782

Please sign in to comment.