Skip to content
This repository has been archived by the owner on Jan 25, 2023. It is now read-only.

Fixes issue #148 by adding python3 support to sign_request.py #243

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

bastianb
Copy link

An attempt to fix #148
Adds supports for python3 to sign_request.py

@hashicorp-cla
Copy link

hashicorp-cla commented Apr 16, 2021

CLA assistant check
All committers have signed the CLA.

@bastianb bastianb force-pushed the fix_issue_148_python3_support_for_sign_request_script branch from 784f79a to fc0ccde Compare April 16, 2021 23:54
@bastianb bastianb force-pushed the fix_issue_148_python3_support_for_sign_request_script branch from fc0ccde to 84f82e7 Compare April 16, 2021 23:57
Comment on lines +25 to 37
def decode_bytes_from_dict_values(dict_, to_go_style=False):
retval = {}
for k, v in headers.iteritems():
retval[k] = [v]
for k, v in dict_.items():
try:
value = v.decode()
except AttributeError:
value = v

if to_go_style:
value = [value]

retval[k] = value
return retval
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think using a single function for these two purposes is confusing. I would probably convert these function calls to inline dict comprehensions (which are 2 and 3 compatible) that do the things we want for each case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sign-request.py is not compatible with python 3.x
3 participants