def toBytes(url):
    # Most URL schemes require ASCII. If that changes, the conversion
    # can be relaxed
    if _is_unicode(url):
        try:
            url = url.encode("ASCII")
        except UnicodeError:
            raise UnicodeError("URL " + repr(url) +
                               " contains non-ASCII characters")
    return url
t.open_r(file) and t.open_w(file) implement
dataset/ETHPy150Open kleientertainment/ds_mod_tools/pkg/win32/Python27/Lib/urllib.py/toBytes--crossover with--dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/pipes.py/Template.open_r