Skip to content
This repository has been archived by the owner on Apr 12, 2021. It is now read-only.

TypeError: Object of type 'PosixPath' is not JSON serializable #1445

Open
adam-stokes opened this issue May 25, 2018 · 3 comments
Open

TypeError: Object of type 'PosixPath' is not JSON serializable #1445

adam-stokes opened this issue May 25, 2018 · 3 comments
Assignees
Labels

Comments

@adam-stokes
Copy link
Contributor

2018-05-24 12:14:50,757 [ERROR] conjure-up/ghost - events.py:204 - Error in cleanup code: Object of type 'PosixPath' is not JSON serializable
Traceback (most recent call last):
  File "/home/adam/Projects/conjure-up/conjureup/events.py", line 185, in shutdown_watcher
    await app.save()
  File "/home/adam/Projects/conjure-up/conjureup/app_config.py", line 232, in save
    self.state[self._internal_state_key] = self.to_json()
  File "/home/adam/Projects/conjure-up/conjureup/app_config.py", line 205, in to_json
    return json.dumps(new_dict)
  File "/home/adam/.pyenv/versions/3.6.2/lib/python3.6/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/home/adam/.pyenv/versions/3.6.2/lib/python3.6/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/home/adam/.pyenv/versions/3.6.2/lib/python3.6/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/home/adam/.pyenv/versions/3.6.2/lib/python3.6/json/encoder.py", line 180, in default
    o.__class__.__name__)
TypeError: Object of type 'PosixPath' is not JSON serializable

@johnsca creating this for placeholder, will look at this in the morning. Need to understand what attribute is still being treated as posixpath

@johnsca
Copy link
Contributor

johnsca commented May 25, 2018

It looks like this is coming from {'conjurefile': 'conf-file': [PosixPath('Conjurefile')]}. We should probably exclude conjurefile entirely, and perhaps we should consider removing the JSON state serialization entirely in favor of writing a Conjurefile.

@adam-stokes adam-stokes self-assigned this May 25, 2018
@adam-stokes
Copy link
Contributor Author

adam-stokes commented May 25, 2018

@johnsca so maybe write out a Conjurefile-timestamp and dont serialize state and even dont write out a bundle file (we still do that it seems)

@stale
Copy link

stale bot commented Sep 22, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants