Skip to content

AttributeError: 'benedict' object has no attribute '_keypath_separator' #6

@bozelosp

Description

@bozelosp

Hola! Happy 2020!

I love this library; best thing that happened to me in months, actually :-)

Now, I'm stumbling upon an issue that I haven't been able to resolve on my own.

It occurs when a pool worker attempts to return a list of totally seperate and independent benedict objects.

Any idea why that might be?

Many thanks,
Panos

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.6/multiprocessing/pool.py", line 463, in _handle_results
    task = get()
  File "/usr/lib/python3.6/multiprocessing/connection.py", line 251, in recv
    return _ForkingPickler.loads(buf.getbuffer())
  File "/usr/local/lib/python3.6/dist-packages/benedict/dicts/keypath.py", line 125, in __setitem__
    self._check_keypath_separator_in_keys(value)
  File "/usr/local/lib/python3.6/dist-packages/benedict/dicts/keypath.py", line 28, in _check_keypath_separator_in_keys
    sep = self._keypath_separator
AttributeError: 'benedict' object has no attribute '_keypath_separator'

Edit 1:

I just tried the same approach minus the multiprocessing part. It is just an iteration of the following:

i) I create a benedict object,
ii) I append it to a list,
iii) If the list has hit a length of 10,000 items I pickle the list, and create a new one.

Upon pickle read I'm getting the same error:

  File "<stdin>", line 2, in <module>
  File "/usr/local/lib/python3.6/dist-packages/benedict/dicts/keypath.py", line 125, in __setitem__
    self._check_keypath_separator_in_keys(value)
  File "/usr/local/lib/python3.6/dist-packages/benedict/dicts/keypath.py", line 28, in _check_keypath_separator_in_keys
    sep = self._keypath_separator
AttributeError: 'benedict' object has no attribute '_keypath_separator'

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions