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

python 3 #6

Open
bsapiro opened this issue Jul 28, 2013 · 0 comments
Open

python 3 #6

bsapiro opened this issue Jul 28, 2013 · 0 comments

Comments

@bsapiro
Copy link

bsapiro commented Jul 28, 2013

to make this library work in python 3, run 2to3 over the code then modify the code starting at line 563 of kt_http.py (the function called _tsv_to_dict ) so that the byte array (which is returned by python 3's urllib) is converted to a string.

def _tsv_to_dict(self, tsv_str):
    rv = {}
    tsv_str = str(tsv_str, encoding='utf8') # <-- this line
    for row in tsv_str.split('\n'):
        kv = row.split('\t')
        if len(kv) == 2:
            rv[kv[0]] = kv[1]
    return rv
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