John Vandenberg has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/243058

Change subject: __all__ items must be bytes on Python 2
......................................................................

__all__ items must be bytes on Python 2

Bug: T111615
Change-Id: Iae8b41678723382ddad1bf1acdf3aed0d75a9413
(cherry picked from commit d8d368a8115319325728f1a32dc627ce3fe33186)
---
M pywikibot/__init__.py
1 file changed, 5 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/58/243058/1

diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index b390191..a6608a3 100644
--- a/pywikibot/__init__.py
+++ b/pywikibot/__init__.py
@@ -50,7 +50,7 @@
     CaptchaError, SpamfilterError, CircularRedirect, InterwikiRedirectPage,
     WikiBaseError, CoordinateGlobeUnknownException,
 )
-from pywikibot.tools import UnicodeMixin, redirect_func
+from pywikibot.tools import PY2, UnicodeMixin, redirect_func
 from pywikibot.i18n import translate
 from pywikibot.data.api import UploadWarning
 from pywikibot.diff import PatchManager
@@ -98,6 +98,10 @@
 # so instead use this trick
 globals()['__all__'] = globals()['__all__'] + textlib_methods
 
+if PY2:
+    # T111615: Python 2 requires __all__ is bytes
+    globals()['__all__'] = tuple(bytes(item) for item in __all__)
+
 for _name in textlib_methods:
     target = getattr(textlib, _name)
     wrapped_func = redirect_func(target)

-- 
To view, visit https://gerrit.wikimedia.org/r/243058
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iae8b41678723382ddad1bf1acdf3aed0d75a9413
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: 2.0
Gerrit-Owner: John Vandenberg <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to