Error on init() for unpickling NoValidConnectionError #617

Closed
rschlussel opened this Issue Nov 9, 2015 · 1 comment

Projects

None yet

2 participants

@rschlussel

If you try pickling and then unpickling NoValidConnectionError, you get the following exception:
TypeError: __init__() takes exactly 2 arguments (3 given)

It seems to be passing the errno and string with the error message while init expects a dict.

Here is some simple code to reproduce the issue:

from paramiko import ssh_exception.NoValidConnectionsError
import pickle
err = NoValidConnectionsError({'ab': ''})
p = pickle.dumps(err)
unpickled = pickle.loads(p)

A more practical application is for example if you are using the multiprocessing module and a child process raises a NoValidConnectionError.

@bitprophet bitprophet added this to the 1.16.1 milestone Nov 19, 2015
@mgedmin mgedmin added a commit to mgedmin/paramiko that referenced this issue Feb 4, 2016
@mgedmin mgedmin Make NoValidConnectionsError picklable correctly
Fixes #617.
ad02aa0
@bitprophet
Member

Solved in #679.

@bitprophet bitprophet closed this Apr 24, 2016
@bitprophet bitprophet added a commit that referenced this issue Apr 24, 2016
@bitprophet bitprophet Changelog re #617, #679, #678, #685.
Also re fabric/fabric#1429 but IDK if Github will tickle that repo correctly :D
e2206bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment