6
我試圖grep的日誌中包含multipe行消息時遇到以下錯誤...任何人都可以提供有關如何克服此錯誤的輸入?bufsize必須是一個整數錯誤,同時grepping一條消息
CODE: -
print gerrit_commitmsg
gerritlog = Popen('git','log','--grep','gerrit_commitmsg', stdout=PIPE, stderr=PIPE)
print gerritlog
錯誤: -
Commit message:-
Build system changes
Build system changes to include packages in the build
Change-Id: I697558f01ae367d2baacdf2c7fcf1a03753edacd
Traceback (most recent call last):
File "gerrits_in_workspace.py", line 87, in <module>
main()
File "gerrits_in_workspace.py", line 77, in main
grep_commitmsg(gerrit_commitmsg)
File "gerrits_in_workspace.py", line 48, in grep_commitmsg
gerritlog = Popen('git','log','--grep','gerrit_commitmsg', stdout=PIPE, stderr=PIPE)
File "/usr/lib/python2.7/subprocess.py", line 629, in __init__
raise TypeError("bufsize must be an integer")
感謝,我也想給grep什麼是gerrit_commitmsg但不是字符串gerrit_commitmsg本身,對任何提示我們該怎麼辦呢? – user1934146
這是一個不同的問題,你最好打賭可能在這裏發佈一個新的問題。 – larsks