jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/401374 )
Change subject: [FIX] Add Python version to apicache directory name
......................................................................
[FIX] Add Python version to apicache directory name
Add Python version to apicache directory name because Python 3 can not load
cache entries created by Python 2, resulting in lots of warning messages when
running on both versions.
Bug: T183857
Change-Id: Id225d7b688428b0608894708dea0191b2628ec6f
---
M pywikibot/data/api.py
1 file changed, 5 insertions(+), 4 deletions(-)
Approvals:
Framawiki: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/data/api.py b/pywikibot/data/api.py
index 9e2627d..8ab2eec 100644
--- a/pywikibot/data/api.py
+++ b/pywikibot/data/api.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
"""Interface to Mediawiki's api.php."""
#
-# (C) Pywikibot team, 2007-2017
+# (C) Pywikibot team, 2007-2018
#
# Distributed under the terms of the MIT license.
#
@@ -38,8 +38,8 @@
Error, TimeoutError, InvalidTitle, UnsupportedPage
)
from pywikibot.tools import (
- MediaWikiVersion, deprecated, itergroup, ip, PY2, getargspec,
- UnicodeType
+ MediaWikiVersion, deprecated, itergroup, ip, PY2, PYTHON_VERSION,
+ getargspec, UnicodeType
)
from pywikibot.tools.formatter import color_format
@@ -2242,7 +2242,8 @@
@return: base directory path for cache entries
@rtype: basestring
"""
- path = os.path.join(pywikibot.config2.base_dir, 'apicache')
+ path = os.path.join(pywikibot.config2.base_dir,
+ 'apicache-py{0:d}'.format(PYTHON_VERSION[0]))
cls._make_dir(path)
return path
--
To view, visit
https://gerrit.wikimedia.org/r/401374
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id225d7b688428b0608894708dea0191b2628ec6f
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Framawiki <framawiki(a)tools.wmflabs.org>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Merlijn van Deen <valhallasw(a)arctus.nl>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>