gpg.exe(Git-Bash 的一部分)与 "fatal error - add_item" (Windows) 一起崩溃

gpg.exe (part of Git-Bash) crashes with "fatal error - add_item" (Windows)

当 运行 gpg.exe 命令(Git-Bash 的一部分)时,出现以下错误:

gpg (5076) C:\some_path\Git\usr\bin\gpg.exe: *** fatal error - add_item ("\??\C:\some_path\Git", "/", ...) failed, errno 1
Stack trace:

Frame        Function    Args
000FFFFCCE0  001800638AE (00180288FCA, 00180263FD1, 00800000000, 000FFFF8B50)
000FFFFCCE0  0018004973A (00000000000, 000FFFFCCE0, 00180020010, 000FFFFABFE)
000FFFFCCE0  00180049772 (000FFFF9BD0, 00000000001, 00800000000, 525C3A425C3F3F5C)
000FFFFCCE0  001800EB3EF (00000000000, 00040000024, 00000000000, 00000000000)
000FFFFCCE0  0018013DE25 (001800D212A, 00000000000, 00000000000, 00000000000)
000FFFFCCE0  00180049D95 (00000000000, 00000000000, 00000000000, 00000000000)
000FFFFFFF0  00180048846 (00000000000, 00000000000, 00000000000, 00000000000)
000FFFFFFF0  001800488F4 (00000000000, 00000000000, 00000000000, 00000000000)

我在 Windows 服务器上使用 subprocess.runshell=True 调用它,但我也可以在 powershell 中重现此崩溃。

有效的方法是通过 bash.exe:

对整个调用进行“隧道化”
C:\some_path\Git\usr\bin\gpg.exe arg1 arg2

变成

C:\some_path\Git\bin\bash.exe -c "gpg arg1 arg2"

问题神秘消失了!