From a381b08c1bacb4af4753e99d2a18e0a67e28a9c3 Mon Sep 17 00:00:00 2001 From: Olle Lundberg Date: Wed, 1 Oct 2014 13:34:37 +0200 Subject: Make sure we pass parameters as binary on windows. This fixes #320 (thanks @adamkerz). --- paramiko/win_pageant.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/paramiko/win_pageant.py b/paramiko/win_pageant.py index 20b1b0b9..4b482bee 100644 --- a/paramiko/win_pageant.py +++ b/paramiko/win_pageant.py @@ -26,6 +26,7 @@ import ctypes.wintypes import platform import struct from paramiko.util import * +from paramiko.py3compat import b try: import _thread as thread # Python 3.x @@ -43,7 +44,7 @@ win32con_WM_COPYDATA = 74 def _get_pageant_window_object(): - return ctypes.windll.user32.FindWindowA('Pageant', 'Pageant') + return ctypes.windll.user32.FindWindowA(b('Pageant'), b('Pageant')) def can_talk_to_agent(): @@ -90,7 +91,7 @@ def _query_pageant(msg): with pymap: pymap.write(msg) # Create an array buffer containing the mapped filename - char_buffer = array.array("c", b(map_name) + zero_byte) + char_buffer = array.array("b", b(map_name) + zero_byte) char_buffer_address, char_buffer_size = char_buffer.buffer_info() # Create a string to use for the SendMessage function call cds = COPYDATASTRUCT(_AGENT_COPYDATA_ID, char_buffer_size, -- cgit v1.2.3 From cf8921e310005832c82921ce67441cc82af18092 Mon Sep 17 00:00:00 2001 From: Jeff Forcier Date: Wed, 1 Oct 2014 16:54:03 -0700 Subject: Changelog re #320 Closes #409 --- sites/www/changelog.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index 0f79775c..91d4daa7 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,8 @@ Changelog ========= +* :bug:`320` Update our win_pageant module to be Python 3 compatible. Thanks to +``@sherbang`` and ``@adamkerz`` for the patches. * :support:`378 backported` Minor code cleanup in the SSH config module courtesy of Olle Lundberg. * :support:`249` Consolidate version information into one spot. Thanks to Gabi -- cgit v1.2.3