Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upssh2.session.Session.userauth_publickey_frommemory() - TypeError: object of type 'NoneType' has no len() #86
Comments
|
Cleaned up the sample code a bit. |
|
@PhenomPBG the bug remains. #90 doesn't fix it either. I've made a new PR that should fix it. |
Thanks! |
|
I'll take a look into why this isn't picked up via the unit tests and correct that, then fix the issue itself. |
Add enums to clean up any symbols from libssh2 and make interacting with them much easier to do. Add additional unit tests for ParallelSSH#86
|
I know this isn't an amazing answer but I can't replicate this issue with #90 using the same arguments passed inside of a unit test. Sadly this repository is over the limit for git LFS usage so the builds won't work, so I've managed to bypass LFS for now inside the builds. Travis is returning no errors in the unit tests for this particular issue. @j3pic I'm happy to take patches on my fork because right now it appears that @pkittenis isn't around. |
|
@Red-M Will your fork become the version of |
|
I'd hope my fork gets merged into |
|
There's another problem with my patch: It doesn't compile under Python 3.7 and higher because the C source files were built with the wrong version of Cython (but if I upgrade and generate the C files again, they'll be incompatible with Python 3.6 and below. |
|
What version should Cython be? |
|
My fork has every version passing the tests plus 3.8, https://travis-ci.com/Red-M/ssh2-python/builds/141552354 |
|
@Red-M Reading the code for #90 it looks like this bug should be fixed there. I'm not sure why I still saw it when I tested manually. Probably because of the bug in Pip I found that affects the use of Git repos from requirements.txt. There's a nonzero chance I was still running the version of ssh2-python from PyPI. |
|
still experiencing this issue. On a side note, if I use the same key and auth from file, it works. Same error thrown as above poster: File "ssh2/session.pyx", line 237, in ssh2.session.Session.userauth_publickey_frommemory Private key provided |
Add enums to clean up any symbols from libssh2 and make interacting with them much easier to do. Add additional unit tests for ParallelSSH#86
|
A workaround that seems to work for me is to set the publickeyfiledata to an empty bytestring ( |
Last line from stack trace:
File "ssh2/session.pyx", line 240, in ssh2.session.Session.userauth_publickey_frommemory
TypeError: object of type 'NoneType' has no len()
Seems like the optional argument publickeyfiledata defaults to None, but its len() is always checked anyway.
Tested on both 0.17 and 0.18 with Python 3.7.1 on CentOS 7.