Argument error on connect: int too long to convert #758
Comments
I think that this is related to the confusing int sizes on x86-64 windows and advapi32.dll. |
force user SID to be cast as longlong, brought up in paramiko#758
Most/all of the code in |
This issue has resurfaced for me, I cannot open an ssh connection to anywhere with paramiko right now. I'm using an Anaconda 2.4.1 64-bit installation of Python 3.5.1, with paramiko 2.0.1. Tried updating paramiko, but I couldn't find a newer version. Also, the issue is really strange, because until today, everything worked fine for me. I haven't changed anything, no windows reinstall, no python reinstall, nothing. Could have a silent windows update cause it? |
The issue has been corrected upstream (though it's quite possible there are other, related, failures that the test suite doesn't yet cover. The next step will be to re-vendor these changes into paramiko and test them. Would someone be wiling to do that? |
@jaraco How can I help? What should I do? |
Awesome. Thanks for offering to help @miso-belica. The
or similar, replace the content with the contents from that module in jaraco.windows. You'll want to disregard imports... and there may be other aspects that you can disregard. It's been a while since I've last done it. With any luck, when you're done, the diff on the |
@jaraco I ended with this diff diff --git a/paramiko/_winapi.py b/paramiko/_winapi.py
index 77e0129..94bf601 100644
--- a/paramiko/_winapi.py
+++ b/paramiko/_winapi.py
@@ -118,6 +118,18 @@ CreateFileMapping.restype = ctypes.wintypes.HANDLE
MapViewOfFile = ctypes.windll.kernel32.MapViewOfFile
MapViewOfFile.restype = ctypes.wintypes.HANDLE
+UnmapViewOfFile = ctypes.windll.kernel32.UnmapViewOfFile
+UnmapViewOfFile.argtypes = ctypes.wintypes.HANDLE,
+
+RtlMoveMemory = ctypes.windll.kernel32.RtlMoveMemory
+RtlMoveMemory.argtypes = (
+ ctypes.c_void_p,
+ ctypes.c_void_p,
+ ctypes.c_size_t,
+)
+
+ctypes.windll.kernel32.LocalFree.argtypes = ctypes.wintypes.HLOCAL,
+
#####################
# jaraco.windows.mmap
@@ -307,6 +319,13 @@ class SECURITY_ATTRIBUTES(ctypes.Structure):
self._descriptor = value
self.lpSecurityDescriptor = ctypes.addressof(value)
+
+ctypes.windll.advapi32.SetSecurityDescriptorOwner.argtypes = (
+ ctypes.POINTER(SECURITY_DESCRIPTOR),
+ ctypes.c_void_p,
+ ctypes.wintypes.BOOL,
+)
+
#########################
# jaraco.windows.security
And works like a charm |
Looks good to me. I'll apply that and submit a PR. Thanks for testing. |
That diff also worked for me |
Merged PR, this will be out in next bugfix release (today). |
Attempting to perform a simple connection with IP address on local network, username and password yields the following error:
ArgumentError: argument 2: <class 'OverflowError'>: int too long to convert
I'm running this in the iPython interpreter, on a 64-bit machine with Anaconda as the base python environment:
The sequence of commands:
The full stack trace (some identifying info commented out with ***):
The text was updated successfully, but these errors were encountered: