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

_pickle.PicklingError: Cannot pickle ResolverMatch. #133

Open
suncowiam opened this issue May 13, 2023 · 1 comment
Open

_pickle.PicklingError: Cannot pickle ResolverMatch. #133

suncowiam opened this issue May 13, 2023 · 1 comment
Labels

Comments

@suncowiam
Copy link

suncowiam commented May 13, 2023

Hi all,
Not sure if this is an issue with widget-tweaks. I'm trying to run the demo of django-modal-form and am running into the following issue:

Internal Server Error: /modal/signup/
Traceback (most recent call last):
  File "C:\Users\sunco\AppData\Roaming\Python\Python39\site-packages\django\core\handlers\exception.py", line 55, in inner
    response = get_response(request)
  File "C:\Users\sunco\AppData\Roaming\Python\Python39\site-packages\django\core\handlers\base.py", line 220, in _get_response
    response = response.render()
  File "C:\Users\sunco\AppData\Roaming\Python\Python39\site-packages\django\template\response.py", line 111, in render
    self.content = self.rendered_content
  File "C:\Users\sunco\AppData\Roaming\Python\Python39\site-packages\django\template\response.py", line 89, in rendered_content
    return template.render(context, self._request)
  File "C:\Users\sunco\AppData\Roaming\Python\Python39\site-packages\django\template\backends\django.py", line 61, in render
    return self.template.render(context)
  File "C:\Users\sunco\AppData\Roaming\Python\Python39\site-packages\django\template\base.py", line 175, in render
    return self._render(context)
  File "C:\Users\sunco\AppData\Roaming\Python\Python39\site-packages\django\test\utils.py", line 112, in instrumented_test_render
    return self.nodelist.render(context)
  File "C:\Users\sunco\AppData\Roaming\Python\Python39\site-packages\django\template\base.py", line 1005, in render
    return SafeString("".join([node.render_annotated(context) for node in self]))
  File "C:\Users\sunco\AppData\Roaming\Python\Python39\site-packages\django\template\base.py", line 1005, in <listcomp>
    return SafeString("".join([node.render_annotated(context) for node in self]))
  File "C:\Users\sunco\AppData\Roaming\Python\Python39\site-packages\django\template\base.py", line 966, in render_annotated
    return self.render(context)
  File "C:\Users\sunco\AppData\Roaming\Python\Python39\site-packages\django\template\defaulttags.py", line 238, in render
    nodelist.append(node.render_annotated(context))
  File "C:\Users\sunco\AppData\Roaming\Python\Python39\site-packages\django\template\base.py", line 966, in render_annotated
    return self.render(context)
  File "C:\Users\sunco\AppData\Roaming\Python\Python39\site-packages\widget_tweaks\templatetags\widget_tweaks.py", line 194, in render
    bounded_field = set_attr(bounded_field, '%s:%s' % (k,v.resolve(context)))
  File "C:\Users\sunco\AppData\Roaming\Python\Python39\site-packages\widget_tweaks\templatetags\widget_tweaks.py", line 15, in wrapped
    return fn(field, attr)
  File "C:\Users\sunco\AppData\Roaming\Python\Python39\site-packages\widget_tweaks\templatetags\widget_tweaks.py", line 56, in set_attr
    return _process_field_attributes(field, attr, process)
  File "C:\Users\sunco\AppData\Roaming\Python\Python39\site-packages\widget_tweaks\templatetags\widget_tweaks.py", line 31, in _process_field_attributes
    field = copy.deepcopy(field)
  File "C:\Program Files\Python39\lib\copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "C:\Program Files\Python39\lib\copy.py", line 270, in _reconstruct
    state = deepcopy(state, memo)
  File "C:\Program Files\Python39\lib\copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "C:\Program Files\Python39\lib\copy.py", line 230, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "C:\Program Files\Python39\lib\copy.py", line 172, in deepcopy
    y = _reconstruct(x, memo, *rv)
  File "C:\Program Files\Python39\lib\copy.py", line 270, in _reconstruct
    state = deepcopy(state, memo)
  File "C:\Program Files\Python39\lib\copy.py", line 146, in deepcopy
    y = copier(x, memo)
  File "C:\Program Files\Python39\lib\copy.py", line 230, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "C:\Program Files\Python39\lib\copy.py", line 153, in deepcopy
    y = copier(memo)
  File "C:\Users\sunco\AppData\Roaming\Python\Python39\site-packages\django\http\request.py", line 98, in __deepcopy__
    setattr(obj, attr, copy.deepcopy(getattr(self, attr), memo))
  File "C:\Program Files\Python39\lib\copy.py", line 161, in deepcopy
    rv = reductor(4)
  File "C:\Users\sunco\AppData\Roaming\Python\Python39\site-packages\django\urls\resolvers.py", line 102, in __reduce_ex__
    raise PicklingError(f"Cannot pickle {self.__class__.__qualname__}.")
_pickle.PicklingError: Cannot pickle ResolverMatch.

Looked online for this but could not find anything. Any help would be appreciated. Thanks

@zodman
Copy link
Member

zodman commented Jul 13, 2023

more info needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants