Skip to content

in windows, xargs.py too large command line #1604

@ufwtlsb

Description

@ufwtlsb

I use pre-commit to check java in windows
pre-commit run -a

get
The command line is too long.

I find xargs.py _get_platform_max_length too large size

I change it ,then can run

def _get_platform_max_length() -> int:  # pragma: no cover (platform specific)
    if os.name == 'posix':
        maximum = os.sysconf('SC_ARG_MAX') - 2048 - _environ_size()
        maximum = max(min(maximum, 2 ** 17), 2 ** 12)
        return maximum
    elif os.name == 'nt':
        return 2 ** 13 - 2048  # UNICODE_STRING max - headroom
    else:
        # posix minimum
        return 2 ** 12

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions