John Vandenberg has uploaded a new change for review.
https://gerrit.wikimedia.org/r/204017
Change subject: More Win32 os.environ issues
......................................................................
More Win32 os.environ issues
Change-Id: I107bf72209d3d6f1ae62ecad4c3e8c989160ae05
---
M pwb.py
M tests/aspects.py
M tests/utils.py
3 files changed, 6 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/17/204017/1
diff --git a/pwb.py b/pwb.py
index 365a22e..56a99fe 100644
--- a/pwb.py
+++ b/pwb.py
@@ -157,7 +157,7 @@
# If successful, user-config.py already exists in one of the candidate
# directories. See config2.py for details on search order.
# Use env var to communicate to config2.py pwb.py location (bug 72918).
- os.environ['PYWIKIBOT2_DIR_PWB'] = os.path.split(__file__)[0]
+ os.environ[str('PYWIKIBOT2_DIR_PWB')] = str(os.path.split(__file__)[0])
import pywikibot # noqa
except RuntimeError as err:
# user-config.py to be created
diff --git a/tests/aspects.py b/tests/aspects.py
index 78cd606..4071242 100644
--- a/tests/aspects.py
+++ b/tests/aspects.py
@@ -1157,14 +1157,14 @@
self.orig_pywikibot_dir = None
if 'PYWIKIBOT2_DIR' in os.environ:
self.orig_pywikibot_dir = os.environ['PYWIKIBOT2_DIR']
- os.environ['PYWIKIBOT2_DIR'] = pywikibot.config.base_dir
+ os.environ[str('PYWIKIBOT2_DIR')] = pywikibot.config.base_dir
def tearDown(self):
"""Restore the environment after running the pwb.py script."""
super(PwbTestCase, self).tearDown()
del os.environ['PYWIKIBOT2_DIR']
if self.orig_pywikibot_dir:
- os.environ['PYWIKIBOT2_DIR'] = self.orig_pywikibot_dir
+ os.environ[str('PYWIKIBOT2_DIR')] = self.orig_pywikibot_dir
def _execute(self, args, data_in=None, timeout=0, error=None):
from tests.utils import execute_pwb
diff --git a/tests/utils.py b/tests/utils.py
index d23fd91..92727a5 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -260,13 +260,13 @@
# str() on Python 2.
env = os.environ.copy()
# sys.path may have been modified by the test runner to load dependencies.
- env['PYTHONPATH'] = ":".join(sys.path)
+ env[str('PYTHONPATH')] = str(":".join(sys.path))
# LC_ALL is used by i18n.input as an alternative for userinterface_lang
if pywikibot.config.userinterface_lang:
- env['LC_ALL'] = str(pywikibot.config.userinterface_lang)
+ env[str('LC_ALL')] = str(pywikibot.config.userinterface_lang)
# Set EDITOR to an executable that ignores all arguments and does nothing.
if sys.platform == 'win32':
- env['EDITOR'] = str('call')
+ env[str('EDITOR')] = str('call')
else:
env['EDITOR'] = 'true'
options = {
--
To view, visit https://gerrit.wikimedia.org/r/204017
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I107bf72209d3d6f1ae62ecad4c3e8c989160ae05
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits