Python 2.4.x здесь.
Ударил меня по голове, пытаясь заставить подпроцесс работать с glob.
Ну вот и проблемная зона.
def runCommands(thecust, thedevice):
thepath='/smithy/%s/%s' % (thecust,thedevice)
thefiles=glob.glob(thepath + '/*.smithy.xml')
p1=subprocess.Popen(["grep", "<record>"] + thefiles, stdout=subprocess.PIPE)
p2=subprocess.Popen(['wc -l'], stdin=p1.stdout, stdout=subprocess.PIPE)
p1.stdout.close()
thecount=p2.communicate()[0]
p1.wait()
Я получаю многочисленные ошибки "grep: записывающий вывод: Broken pipe" на экране.
Это должно быть что-то простое, чего мне не хватает, я просто не могу это заметить. Есть идеи?
Заранее спасибо.