jenkins-bot has submitted this change. (
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1235567?usp=email )
Change subject: IMPR: use explicit utf-8 encoding with
GraphSavingThread.graph.write
......................................................................
IMPR: use explicit utf-8 encoding with GraphSavingThread.graph.write
Bug: T415891
Change-Id: Icb8a4e59cab0a9f99e36be5bb6aebeb7d174aeb2
---
M pywikibot/interwiki_graph.py
1 file changed, 9 insertions(+), 4 deletions(-)
Approvals:
jenkins-bot: Verified
Xqt: Looks good to me, approved
diff --git a/pywikibot/interwiki_graph.py b/pywikibot/interwiki_graph.py
index efbf8a5..04596c1 100644
--- a/pywikibot/interwiki_graph.py
+++ b/pywikibot/interwiki_graph.py
@@ -41,14 +41,19 @@
self.origin = origin
def run(self) -> None:
- """Write graphs to the data directory."""
+ """Write graphs to the data directory.
+
+ .. versionchanged:: 11.0
+ use explicit ``utf-8`` encoding.
+ """
for fmt in config.interwiki_graph_formats:
filename = config.datafilepath(
'interwiki-graphs/' + getFilename(self.origin, fmt))
- if self.graph.write(filename, prog='dot', format=fmt):
- pywikibot.info('Graph saved as ' + filename)
+ if self.graph.write(filename, prog='dot', format=fmt,
+ encoding='utf-8'):
+ pywikibot.info(f'Graph saved as {filename}')
else:
- pywikibot.info('Graph could not be saved as ' + filename)
+ pywikibot.info(f'Graph could not be saved as {filename}')
class Subject:
--
To view, visit
https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1235567?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: Icb8a4e59cab0a9f99e36be5bb6aebeb7d174aeb2
Gerrit-Change-Number: 1235567
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <[email protected]>
Gerrit-Reviewer: JJMC89 <[email protected]>
Gerrit-Reviewer: Xqt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
Pywikibot-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]