Skip to content

ValueError when refreshing token #68

@dylanlingelbach

Description

@dylanlingelbach

When base.py tries to refresh a token upon a 401 error, a ValueError is raised because the syntax for log message format is incorrect.

Line 181 should read:

self.log.info('Retrying with new token %s' % (self.access_token))

not

self.log.info('Retrying with new token %' % (self.access_token))

The stack trace for the error is:

Traceback (most recent call last):
  <Our code elided>
  File "/Users/dylanl/Code/core/core-env/src/hapipy-master/hapi/workflows.py", line 34, in enroll_contact
  File "/Users/dylanl/Code/core/core-env/src/hapipy-master/hapi/base.py", line 209, in _call
    result = self._call_raw(subpath, params=params, method=method, data=data, doseq=doseq, query=query, retried=False, **options)
  File "/Users/dylanl/Code/core/core-env/src/hapipy-master/hapi/base.py", line 182, in _call_raw
    self.log.info('Retrying with new token %' % (self.access_token))
ValueError: incomplete format

I can create a PR if needed. My fork has a few other changes that aren't ready to merge and the change is so trivial I figured a PR would be overkill.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions