jenkins-bot has submitted this change and it was merged.
Change subject: (bug 55129)(bug 54898) Add nightlies version file support ......................................................................
(bug 55129)(bug 54898) Add nightlies version file support
The nightly generation has also been updated to use this format.
This is also a workaround for Bug 61310 (bot will not crash anymore)
Change-Id: Idf6114558b63627ab56f7c16d9f6f3ce436aa706 --- M pywikibot/version.py 1 file changed, 7 insertions(+), 5 deletions(-)
Approvals: Mpaa: Looks good to me, approved Nullzero: Looks good to me, but someone else must approve Russell Blau: Looks good to me, but someone else must approve jenkins-bot: Verified
diff --git a/pywikibot/version.py b/pywikibot/version.py index 1a63073..26417f4 100644 --- a/pywikibot/version.py +++ b/pywikibot/version.py @@ -50,10 +50,10 @@ (tag, rev, date, hsh) = getversion_svn(_program_dir) else: (tag, rev, date, hsh) = getversion_git(_program_dir) - except ParseError: + except Exception: try: (tag, rev, date, hsh) = getversion_nightly() - except ParseError: + except Exception: try: version = getfileversion('pywikibot/__init__.py') if not version: @@ -162,13 +162,15 @@
def getversion_nightly(): - data = open(os.path.join(wikipediatools.get_base_dir(), 'version')) + data = open(os.path.join(os.path.split(__file__)[0], 'version')) tag = data.readline().strip() - date = time.strptime(data.readline()[:19], '%Y-%m-%dT%H:%M:%S') rev = data.readline().strip() + date = time.strptime(data.readline()[:19], '%Y-%m-%dT%H:%M:%S') + hsh = data.readline().strip() + if not date or not tag or not rev: raise ParseError - return (tag, rev, date, '(unknown)') + return (tag, rev, date, hsh)
def getversion_onlinerepo(repo=None):
pywikibot-commits@lists.wikimedia.org