Xqt has submitted this change and it was merged.
Change subject: bug fix for issues raised in change 76486 ......................................................................
bug fix for issues raised in change 76486
* adopt version.py in order to solve win compatibility issues (remove 'cat' and 'wc')
Change-Id: I1848a5c2f914e81a11fb4befa6c2ead570f81341 --- M pywikibot/version.py 1 file changed, 3 insertions(+), 3 deletions(-)
Approvals: DrTrigon: Checked; Looks good to me, but someone else must approve Xqt: Looks good to me, approved
diff --git a/pywikibot/version.py b/pywikibot/version.py index eb3e22c..c97daf0 100644 --- a/pywikibot/version.py +++ b/pywikibot/version.py @@ -120,18 +120,18 @@ tag = tag[(s + 6):e] t = tag.strip().split('/') tag = '[%s] %s' % (t[0][:-1], '/'.join(t[3:])[:-4]) - info = subprocess.Popen("git log --pretty=format:'%ad|%an|%h|%H|%d' --abbrev-commit --date=iso -1 | cat -", + info = subprocess.Popen('git --no-pager log --pretty=format:"%ad|%an|%h|%H|%d" --abbrev-commit --date=iso -1', cwd=_program_dir, shell=True, stdout=subprocess.PIPE).stdout.read() info = info.split('|') date = info[0][:-6] date = time.strptime(date, '%Y-%m-%d %H:%M:%S') - rev = subprocess.Popen('git rev-list HEAD | wc -l', + rev = subprocess.Popen('git rev-list HEAD', cwd=_program_dir, shell=True, stdout=subprocess.PIPE).stdout.read() - rev = int(rev.strip()) + rev = len(rev.splitlines()) hsh = info[3] # also stored in '.git/refs/heads/master' if (not date or not tag or not rev) and not path: raise ParseError
pywikibot-commits@lists.wikimedia.org