jenkins-bot has submitted this change and it was merged.
Change subject: __all__ items must be bytes on Python 2
......................................................................
__all__ items must be bytes on Python 2
Bug: T111615
Change-Id: Iae8b41678723382ddad1bf1acdf3aed0d75a9413
---
M pywikibot/__init__.py
1 file changed, 5 insertions(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/__init__.py b/pywikibot/__init__.py
index 64b2f07..51eafed 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
@@ -99,6 +99,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/236358
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iae8b41678723382ddad1bf1acdf3aed0d75a9413
Gerrit-PatchSet: 3
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: John Vandenberg <[email protected]>
Gerrit-Reviewer: John Vandenberg <[email protected]>
Gerrit-Reviewer: Ladsgroup <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
Pywikibot-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot-commits