def _escape_shell_chars(arg):
    """
    An attempt to sanitize shell arguments without disabling
    shell expansion.

    >>> _escape_shell_chars('This (; file has funky chars')
    'This \\(\\; file has funky chars'
    """
    arg = arg.replace("(", "\\(")
    arg = arg.replace(";", "\\;")
    arg = arg.replace(")", "\\)")

    return arg