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

webapp.py - a bytes-like object is required #50

Open
KKSzymanowski opened this issue Aug 6, 2021 · 1 comment
Open

webapp.py - a bytes-like object is required #50

KKSzymanowski opened this issue Aug 6, 2021 · 1 comment

Comments

@KKSzymanowski
Copy link

Hello,

I'm following this tutorial while setting up a bridge between shotgrid and Jira.
After running the webapp.py script and hitting the port 9090 with curl I'm getting this error:

image

Have I configured something wrong?

Below I highlighted the line causing the error. In my case the content variable is a string containing the HTML response with <h2>The server is alive</h2>

image

I'm on the latest commit on master, tag: v0.3.1

@KKSzymanowski
Copy link
Author

I just noticed some calls to six.ensure_binary in do_GET. Adding it here seems to fix the issue.

        path_parts = [x for x in self.path[1:].split("/") if x]
        if not path_parts:
            self.post_response(
                200,
                "The server is alive",
---             HMTL_TEMPLATE % ("The server is alive", "The server is alive", ""),
+++             six.ensure_binary(HMTL_TEMPLATE % ("The server is alive", "The server is alive", "")),
            )
            return

Should I make a PR with this fix?

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

No branches or pull requests

1 participant