powervm / pypowervm

Python library for interacting with the PowerVM API
Apache License 2.0
26 stars 14 forks source link

Test failure under Python 3.6 #2

Closed thomasgoirand closed 7 years ago

thomasgoirand commented 7 years ago

Hi,

Running unit tests under Python 3.6 leads to this:

====================================================================== FAIL: pypowervm.tests.test_session.TestSession.test_session_clone pypowervm.tests.test_session.TestSession.test_session_clone

_StringException: Traceback (most recent call last): File "/usr/lib/python3/dist-packages/mock/mock.py", line 1305, in patched return func(*args, *keywargs) File "/home/zigo/sources/openstack/pike/python-pypowervm/build-area/python-pypowervm-1.1.6+dfsg1/pypowervm/tests/test_session.py", line 148, in test_session_clone sess_deepclone = copy.deepcopy(sess) File "/usr/lib/python3.6/copy.py", line 180, in deepcopy y = _reconstruct(x, memo, rv) File "/usr/lib/python3.6/copy.py", line 280, in _reconstruct state = deepcopy(state, memo) File "/usr/lib/python3.6/copy.py", line 150, in deepcopy y = copier(x, memo) File "/usr/lib/python3.6/copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/usr/lib/python3.6/copy.py", line 169, in deepcopy rv = reductor(4) TypeError: can't pickle _thread.RLock objects

Note that it does work with Python 3.5.

2uasimojo commented 7 years ago

Thanks for this. Opened https://bugs.launchpad.net/pypowervm/+bug/1722413 to track the fix.

2uasimojo commented 7 years ago

Fix released via https://github.com/powervm/pypowervm/commit/f1064ed9457f29dab4ede79260eff6cdb03ef641

Closed bug https://bugs.launchpad.net/pypowervm/+bug/1722413