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

Commit

Permalink
Fix Python3 in ansible-connection (ansible#27645)
Browse files Browse the repository at this point in the history
* Fix Python3 in ansible-connection

* Add `errors='surrogate_or_strict'` to `to_bytes()`
  • Loading branch information
Qalthos authored Aug 2, 2017
1 parent b0efbc5 commit a340441
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/ansible-connection
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,8 @@ class Server():
break
time.sleep(1)
timeout -= 1
return 0, b'\n#SOCKET_PATH#: %s\n' % self.socket_path, ''
socket_bytes = to_bytes(self.socket_path, errors='surrogate_or_strict')
return 0, b'\n#SOCKET_PATH#: %s\n' % socket_bytes, ''


def communicate(sock, data):
Expand Down

0 comments on commit a340441

Please sign in to comment.