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

Error with Serialization of user_lookup #2

Open
demonspork opened this issue Nov 26, 2019 · 1 comment
Open

Error with Serialization of user_lookup #2

demonspork opened this issue Nov 26, 2019 · 1 comment
Assignees
Labels
Acknowledged I have seen the report, but may not have had time to address it yet.

Comments

@demonspork
Copy link

demonspork commented Nov 26, 2019

User_lookup apparently isn't liked by line 158 of main.py. I have to copy out that logger.info call to get this to even run. I also haven't gotten it to accept my login yet but I'm still working on that (just says you did not login with the right account)

I also had to add "scope: email" to the provider info because none of the examples suggested that that I could find and google errored about missing it in the request.

I don't really know python so I'm not sure how far I will get though.

Traceback (most recent call last):
  File "/usr/local/bin/oauthsub", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.4/dist-packages/oauthsub/__main__.py", line 158, in main
    json.dumps(config_dict, indent=2, sort_keys=True))
  File "/usr/lib/python3.4/json/__init__.py", line 237, in dumps
    **kw).encode(obj)
  File "/usr/lib/python3.4/json/encoder.py", line 194, in encode
    chunks = list(chunks)
  File "/usr/lib/python3.4/json/encoder.py", line 422, in _iterencode
    yield from _iterencode_dict(o, _current_indent_level)
  File "/usr/lib/python3.4/json/encoder.py", line 396, in _iterencode_dict
    yield from chunks
  File "/usr/lib/python3.4/json/encoder.py", line 429, in _iterencode
    o = _default(o)
  File "/usr/lib/python3.4/json/encoder.py", line 173, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: <function default_user_lookup at 0x760ef540> is not JSON serializable

I have attempted to build a configuration, both with and without defining a user_lookup function in the config file and the result is the same, a TypeError for the user_lookup fu

@cheshirekow
Copy link
Owner

Oooh, yeah, I think that the config is written to the console on start. If I recall I dump it as json because I'm lazy. Of course a custom function would fail to serialize. I will fix that!

@cheshirekow cheshirekow self-assigned this Nov 26, 2019
@cheshirekow cheshirekow added the Acknowledged I have seen the report, but may not have had time to address it yet. label Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Acknowledged I have seen the report, but may not have had time to address it yet.
Projects
None yet
Development

No branches or pull requests

2 participants