Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copying the mockClient (to pass it to child tasks) failed because mod… #723

Merged
merged 3 commits into from Jun 20, 2023

Conversation

bartvanb
Copy link
Member

…ule attribute could not be copied. Now not setting algorithm module as attribute

This change resolves the error below, which occurred because the MockClient had the self.lib attribute which is a module and could not be copy.deepcopy'd

Traceback (most recent call last):
    average_task = client.task.create(
  File "c:\users\bbe2101.54580\projects\vantage6\vantage6-master\vantage6-client\vantage6\tools\mock_client.py", line 294, in create
  File "C:\Users\bbe2101.54580\AppData\Local\miniconda3\envs\t3100rc1\lib\copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "C:\Users\bbe2101.54580\AppData\Local\miniconda3\envs\t3100rc1\lib\copy.py", line 271, in _reconstruct
    state = deepcopy(state, memo)
  File "C:\Users\bbe2101.54580\AppData\Local\miniconda3\envs\t3100rc1\lib\copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "C:\Users\bbe2101.54580\AppData\Local\miniconda3\envs\t3100rc1\lib\copy.py", line 231, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "C:\Users\bbe2101.54580\AppData\Local\miniconda3\envs\t3100rc1\lib\copy.py", line 161, in deepcopy
TypeError: cannot pickle 'module' object

…ule attribute could not be copied. Now not setting algorithm module as attribute
Copy link
Contributor

@frankcorneliusmartin frankcorneliusmartin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@bartvanb bartvanb merged commit 38f54a0 into main Jun 20, 2023
2 checks passed
@bartvanb bartvanb deleted the bugfix/mockclient-deepcopy-failed branch June 20, 2023 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants