1. Sybren Stüvel
  2. python-rsa
  3. Issues


Issue #12 wontfix

Allow pickling of keys

Sybren Stüvel
repo owner created an issue

Michael D. Mabin writes:

Here is the block of code that generates the key pairs and then attempts to save the pair to the shelve.



db = shelve.open(dbpath)

add RSA key pairs if the don't exist

eiw_ctl = db.get('eiw_ctl',None)

if eiw_ctl == None: eiw_ctl = rsa.newkeys(256) db['eiw_ctl'] = eiw_ctl }}}

And below is the exception thrown when the code attempts to save it to the shelve object:

{{{ Traceback (most recent call last): File "/users/apps/edwi/mabim01/bin/objectmgrx", line 454, in <module> initialize() File "/users/apps/edwi/mabim01/bin/objectmgrx", line 435, in initialize db['eiw_ctl'] = eiw_ctl File "/usr/local/ab/ul_64/lib/python2.7/shelve.py", line 132, in setitem p.dump(value) File "/usr/local/ab/ul_64/lib/python2.7/copy_reg.py", line 77, in _reduce_ex raise TypeError("a class that defines slots without " TypeError: a class that defines slots without defining getstate cannot be pickled }}}

Comments (1)

  1. Log in to comment