jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] reflinks: Use BytesIO for binary data
......................................................................
[FIX] reflinks: Use BytesIO for binary data
As compressed data is binary, a BytesIO object needs to be used to
handle the data. It was in I79703aa4d3a3d1df5cea546cb18152305c3b0cd4
replaced with io.StringIO which only works on strings (or unicode in
Python 2). Before dd558f287f6e786a41a881b0956e43130260a385 it was using
StringIO.StringIO which works on bytes and strings but with that change
io.StringIO was using in Python 3.
Bug: T86462
Change-Id: Ib3ff54242b25578a7387b97e4c6a10b6d21268ea
---
M scripts/reflinks.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
John Vandenberg: Looks good to me, approved
jenkins-bot: Verified
diff --git a/scripts/reflinks.py b/scripts/reflinks.py
index d241476..415d94d 100644
--- a/scripts/reflinks.py
+++ b/scripts/reflinks.py
@@ -601,8 +601,8 @@
# XXX: small issue here: the whole page is downloaded
# through f.read(). It might fetch big files/pages.
# However, truncating an encoded gzipped stream is not
- # an option, for unzipping will fail.
- compressed = io.StringIO(f.read())
+ # an option, or unzipping will fail.
+ compressed = io.BytesIO(f.read())
f = gzip.GzipFile(fileobj=compressed)
# Read the first 1,000,000 bytes (0.95 MB)
--
To view, visit
https://gerrit.wikimedia.org/r/186950
To unsubscribe, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib3ff54242b25578a7387b97e4c6a10b6d21268ea
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: XZise <CommodoreFabianus(a)gmx.de>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: jenkins-bot <>