You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File ".../venv/lib/python3.5/site-packages/django/core/handlers/base.py", line 132, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File ".../venv/lib/python3.5/site-packages/django/utils/decorators.py", line 110, in _wrapped_view
response = view_func(request, *args, **kwargs)
File ".../venv/lib/python3.5/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File ".../venv/lib/python3.5/site-packages/django/contrib/admin/sites.py", line 233, in inner
return view(request, *args, **kwargs)
File ".../venv/lib/python3.5/site-packages/import_export/admin.py", line 241, in import_action
resource = self.get_import_resource_class()(**self.get_import_resource_kwargs(request, *args, **kwargs))
File ".../venv/lib/python3.5/site-packages/import_export/resources.py", line 201, in __init__
self.fields = deepcopy(self.fields)
File "/usr/lib/python3.5/copy.py", line 182, in deepcopy
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib/python3.5/copy.py", line 320, in _reconstruct
value = deepcopy(value, memo)
File "/usr/lib/python3.5/copy.py", line 182, in deepcopy
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib/python3.5/copy.py", line 297, in _reconstruct
state = deepcopy(state, memo)
File "/usr/lib/python3.5/copy.py", line 155, in deepcopy
y = copier(x, memo)
File "/usr/lib/python3.5/copy.py", line 243, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib/python3.5/copy.py", line 182, in deepcopy
y = _reconstruct(x, rv, 1, memo)
File "/usr/lib/python3.5/copy.py", line 297, in _reconstruct
state = deepcopy(state, memo)
File "/usr/lib/python3.5/copy.py", line 155, in deepcopy
y = copier(x, memo)
File "/usr/lib/python3.5/copy.py", line 243, in _deepcopy_dict
y[deepcopy(key, memo)] = deepcopy(value, memo)
File "/usr/lib/python3.5/copy.py", line 166, in deepcopy
y = copier(memo)
Workaround: do not compile regex patterns or move them out of Widgets.
The text was updated successfully, but these errors were encountered:
int-ua
changed the title
"TypeError: cannot deepcopy this pattern object" after upgrading to 1.0.1
"TypeError: cannot deepcopy this pattern object" when there is a Widget with a compiled regular expression attribute
Jun 19, 2018
Hi @int-ua, thanks for opening this issue.
I think that it cannot be fixed as deepcopy does not know how to copy compiled regexp. Django for example override deepcopy to avoid this on field validators. Having a note in Widget docstring should probably be enough?
Yes, looks like a note would do, thank you. I'll close this if you don't mind, as this discussion must be relatively easy to find for those few who encounter this issue.
Version: 1.0.1
Cause: #550
Widget:
Traceback:
Workaround: do not compile regex patterns or move them out of Widgets.
The text was updated successfully, but these errors were encountered: