def file(value, **kwarg):
    """value should be a path to file in the filesystem.
    
    returns a file object
    """
    #a bit weird, but I don't want to hard code default values
    try:
        f = open(value, **kwarg)
    except IOError as e:
        raise ValueError("unable to open %s : %s" % (path.abspath(value), e))
    return f