def url_join(*args):

    if args[0].startswith("http://"):
        url = "http://"
    else:
        url = "/"
    for arg in args:
        arg = str(arg).replace("\\", "/")
        arg_split = arg.split("/")
        for elem in arg_split:
            if elem != "" and elem != "http:":
                url = url + elem + "/"
    # remove trailing slash for filenames
    if os.path.splitext(args[-1])[1]:
        url = url.rstrip("/")
    return url
A file object is its own iterator.
dataset/ETHPy150Open stephenmcd/filebrowser-safe/filebrowser_safe/functions.py/url_join--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/lib/grizzled/grizzled/file/includer.py/Includer.next