Python 3.3.3 Windows 7
Here is the full stack:
Traceback (most recent call last):
File "Blah\MyScript.py", line 578, in Call
output = process.communicate( input=SPACE_KEY, timeout=600 )
File "C:\Python33\lib\subprocess.py", line 928, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File "C:\Python33\lib\subprocess.py", line 1202, in _communicate
self.stdin.write(input)
OSError: [Errno 22] Invalid argument
Run Code Online (Sandbox Code Playgroud)
代码如下所示:
process = subprocess.Popen( arguments,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
universal_newlines=True,
env=environment )
output = process.communicate( input=SPACE_KEY, timeout=600 )
Run Code Online (Sandbox Code Playgroud)
这段代码每天运行数百次没有问题.但是如果在同一台机器上运行多个脚本(相同的脚本,但有时来自不同的文件夹),我会收到错误.脚本没有执行相同的操作(即:当我收到此错误时,另一个脚本没有执行子进程).
subProcess代码使用许多不同的命令行来引发错误.
那么,任何人都知道发生了什么?解释器是否有多个执行问题(在不同的进程中)?相同的代码通常可以正常工作,如果解释器运行相同(或非常相似)的脚本,则会破解.但它们通常执行脚本的不同部分.
我很茫然:在8核机器上使用单个处理器很烦人.
我有这样的事情:
typedef int AnotherType;
template <typename T> Func( T Value );
// And I want to specialize these two cases separately:
template <> bool Func<int>( int Value ) {...}
template <> bool Func<AnotherType>( AnotherType Value ) {...}
Run Code Online (Sandbox Code Playgroud)
我真的不需要专门用于int,我真正需要的是为AnotherType执行不同的函数.我无法更改AnotherType或基本函数的定义.
由于SFINAE,重载也无济于事.