Skip to content

python 3 #6

@bsapiro

Description

@bsapiro

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions