def sanitiseArgs(argv):
    """Sanitises command-line arguments to work around a bug in ``argparse``.

    The ``argparse`` module does not work with non-numeric optional argument
    values that begin with a hyphen, as it thinks that they are argument names
    (see https://bugs.python.org/issue9334).

    This function searches for relevant optional argument names, and prepends
    a space to their values to make sure that ``argparse`` doesn't fall over.

    :arg argv: Command-line arguments
    :returns:  Sanitised command-line arguments
    """
    argv = list(argv)
    toSanitise = [('-nv', [1]), ('--na_values', [1]), ('-re', [1, 2]), (
        '--recoding', [1, 2]), ('-cv', [2]), ('--child_values', [2])]
    for arg, idxs in toSanitise:
        try:
            argidx = argv.index(arg)
        except ValueError:
            continue
        for i in idxs:
            i = i + 1 + argidx
            val = argv[i]
            if val.startswith('-'):
                argv[i] = ' ' + val
    return argv
