Return a (handler, path) tuple
    for a temporary file with given suffix created by ``tempfile``.

    :param string suffix: the suffix (e.g., the extension) of the file
    :param string root: path to the root temporary directory;
                        if ``None``, the default temporary directory
                        will be used instead
    :rtype: tuple

def tmp_file(suffix=u"", root=None):
    """
    Return a (handler, path) tuple
    for a temporary file with given suffix created by ``tempfile``.

    :param string suffix: the suffix (e.g., the extension) of the file
    :param string root: path to the root temporary directory;
                        if ``None``, the default temporary directory
                        will be used instead
    :rtype: tuple
    """
    if root is None:
        root = custom_tmp_dir()
    return tempfile.mkstemp(suffix=suffix, dir=root)