def METHOD_NAME(pyi_builder, monkeypatch):
    distdir = pyi_builder._distdir
    # Create some bytes and decode with the current codepage to get a filename that is guaranteed to encode with the
    # current codepage. Assumes a one-byte codepage, i.e., not cp937 (shift-JIS) which is multibyte.
    cp_filename = bytes(bytearray(range(0x80, 0x86))).decode('mbcs')
    distdir = os.path.join(distdir, cp_filename)
    os.makedirs(distdir)
    # Try to remove ShortFileName from this folder using `fsutil`. Requires admin privileges, so `xfail` if we do not
    # have them. `8dot3name strip` only affects subfolders, so pass the folder containing our codepage filename.
    fsutil_distdir = pyi_builder._distdir
    if subprocess.call(['fsutil', '8dot3name', 'strip', fsutil_distdir]):
        pytest.xfail("Administrator privileges required to strip ShortFileName.")
    tmpdir = os.path.join(str(pyi_builder._tmpdir), cp_filename + "_TMP")
    monkeypatch.setenv('TMPDIR', tmpdir)
    monkeypatch.setenv('TMP', tmpdir)
    pyi_builder._distdir = distdir
    pyi_builder.test_script('pyi_path_encoding.py')