bufsize must be an integer error while grepping a message

前端 未结 1 881
你的背包
你的背包 2020-12-03 15:15

I am running into following error while trying to grep for a message consisting of multipe lines in a log...can anyone provide inputs on how to overcome this error?

相关标签:
1条回答
  • 2020-12-03 15:58

    The subprocess.Popen class expects an argument list like this:

    Popen(args, bufsize=0, ...)
    

    So you're passing it:

    • args = git
    • bufsize = log

    Hence the error (bufsize expects an integer value). The command vector needs to be a list, like this:

    gerritlog = Popen(['git','log','--grep','gerrit_commitmsg'], stdout=PIPE, stderr=PIPE)
    
    0 讨论(0)
提交回复
热议问题