MarketSquare / MarketSquare/Rammbock

Load Copy Of Template raises 'cannot pickle 'socket' object'

Open
#85 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
64
Forks
48
PR merge metrics
No merged PRs in 30d

Description

After defining protocol and setting up value and socket for it the `Load Copy Of Template` can't be used. Test raises an error
```
TypeError: cannot pickle 'socket' object
```

As a workaround I comment out deep copy of template in function:
```
def load_copy_of_template(self, name, *parameters):
"""..."""
template, fields, header_fields = self._set_templates_fields_and_header_fields(name, parameters)
# copy_of_template = copy.deepcopy(template)
copy_of_fields = copy.deepcopy(fields)
self._init_new_message_stack(template, copy_of_fields, header_fields)
```

Can this be fixed?

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate load_copy_of_template and inspect how template, fields, protocol values, and sockets are set up before the failing deepcopy(template) call. Reproduce the error with Load Copy Of Template, then add or update a regression test showing that a template containing a socket can be copied without the cannot pickle socket object failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
networking, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.