jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/606722 )
Change subject: [bugfix] Make Travis update pytest
......................................................................
[bugfix] Make Travis update pytest
Travis has got pytest pre-installed. It has a valid version per our
dev-requirements.txt, so pip doesn't update it. But pytest-cov requires
pytest >= 4.6, which produces version conflict.
Either we can force Travis to update pytest, or we can force Travis
to reinstall it.
Bug: T255349
Change-Id: Ic3127b68d03ca563a674dae8b0d8828926ae24e4
---
M .travis.yml
1 file changed, 2 insertions(+), 0 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.travis.yml b/.travis.yml
index fbac64c..c38352b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -47,6 +47,8 @@
before_script:
- pip install -U setuptools
+ # Make Travis reinstall default pytest (T255349)
+ - pip uninstall pytest
- pip install -r dev-requirements.txt
script:
--
To view, visit https://gerrit.wikimedia.org/r/606722
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic3127b68d03ca563a674dae8b0d8828926ae24e4
Gerrit-Change-Number: 606722
Gerrit-PatchSet: 7
Gerrit-Owner: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/606410 )
Change subject: [IMPR] Simplify http.user_agent_username
......................................................................
[IMPR] Simplify http.user_agent_username
- simplify the code in user_agent_username() and return the
calculated username at the end
Change-Id: Ic21709a50cedbf5cf0451432d39903342a508751
---
M pywikibot/comms/http.py
1 file changed, 3 insertions(+), 5 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/comms/http.py b/pywikibot/comms/http.py
index fd32330..a860996 100644
--- a/pywikibot/comms/http.py
+++ b/pywikibot/comms/http.py
@@ -162,21 +162,19 @@
"""
if not username:
return ''
+
username = username.replace(' ', '_') # Avoid spaces or %20.
try:
username.encode('ascii') # just test, but not actually use it
except UnicodeEncodeError:
- pass
+ username = quote(username.encode('utf-8'))
else:
# % is legal in the default $wgLegalTitleChars
# This is so that ops know the real pywikibot will not
# allow a useragent in the username to allow through a hand-coded
# percent-encoded value.
if '%' in username:
- return quote(username)
- else:
- return username
- username = quote(username.encode('utf-8'))
+ username = quote(username)
return username
--
To view, visit https://gerrit.wikimedia.org/r/606410
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic21709a50cedbf5cf0451432d39903342a508751
Gerrit-Change-Number: 606410
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/606683 )
Change subject: Revert "[IMPR] Always close files finally in throttle.py"
......................................................................
Revert "[IMPR] Always close files finally in throttle.py"
Fails if file cannot be opened:
f.close()
UnboundLocalError: local variable 'f' referenced before assignment
This reverts commit 98fd8fb74998c08a9f1fac4031297bb007848b57.
Change-Id: I044dcf3ff44153d2e754f8b85f03aa16f33fbaf3
---
M pywikibot/throttle.py
1 file changed, 5 insertions(+), 5 deletions(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/throttle.py b/pywikibot/throttle.py
index 047e67c..91b3318 100644
--- a/pywikibot/throttle.py
+++ b/pywikibot/throttle.py
@@ -121,7 +121,6 @@
'site': this_site})
if not pid and this_pid >= my_pid:
my_pid = this_pid + 1 # next unused process id
- finally:
f.close()
if not pid:
@@ -132,12 +131,13 @@
'site': mysite})
processes.sort(key=lambda p: (p['pid'], p['site']))
try:
- with open(self.ctrlfilename, 'w') as f:
- for p in processes:
- f.write('{pid} {time} {site}\n'.format(**p))
+ f = open(self.ctrlfilename, 'w')
+ for p in processes:
+ f.write('%(pid)s %(time)s %(site)s\n' % p)
except IOError:
pass
-
+ else:
+ f.close()
self.process_multiplicity = count
pywikibot.log(
'Found {0} {1} processes running, including this one.'.format(
--
To view, visit https://gerrit.wikimedia.org/r/606683
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I044dcf3ff44153d2e754f8b85f03aa16f33fbaf3
Gerrit-Change-Number: 606683
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/606636 )
Change subject: [doc] Update ROADMAP.rst and HISTORY.rst
......................................................................
[doc] Update ROADMAP.rst and HISTORY.rst
Change-Id: I3d0bef6bb5876af8a7073bd487274c9df5ad10ed
---
M HISTORY.rst
M ROADMAP.rst
2 files changed, 6 insertions(+), 0 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/HISTORY.rst b/HISTORY.rst
index 42c8f1d..a9792fd 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -25,6 +25,7 @@
* Page.getVersionHistory and Page.fullVersionHistory() methods has been desupported (T136513, T151110)
* Update wikimediachapter_family (T250802)
* Raise SpamblacklistError with spamblacklist APIError (T249436)
+* SpamfilterError was renamed to SpamblacklistError (T249436)
* Do not removeUselessSpaces inside source/syntaxhighlight tags (T250469)
* Restrict Pillow to 6.2.2+ (T249911)
* Fix PetScan generator language and project (T249704)
@@ -663,6 +664,7 @@
* Bugfixes
* Localisation updates
* i18n: always follow master branch
+* exception.UploadWarning was replaced by data.api.UploadWarning
2.0rc2
------
@@ -738,6 +740,8 @@
* API client side prevention of anonymous writes
* API layer support for boolean and date datatypes
* Improved MediaWiki version detection
+* PageNotFound exception is no longer used
+* UserActionRefuse exception was replaced by UserRightsError and NotEmailableError
Other changes include:
diff --git a/ROADMAP.rst b/ROADMAP.rst
index e4aa7e2..e8373ee 100644
--- a/ROADMAP.rst
+++ b/ROADMAP.rst
@@ -4,12 +4,14 @@
**Note: This is the last release supporting Python 2 and Python 3.4**
* Resolve namespaces with underlines (T252940)
+* Fix getversion_svn for Python 3.6+ (T253617, T132292)
* Bugfixes and improvements
* Localisation updates
Future releases
~~~~~~~~~~~~~~~
+* 3.0.20200508: PageNotFound, SpamfilterError and UserActionRefuse exceptions will be removed (T253681)
* 3.0.20200508: Page.getVersionHistory and Page.fullVersionHistory() methods will be removed (T136513, T151110)
* 3.0.20200405: Site and Page methods deprecated for 10 years or longer will be removed
* 3.0.20200326: Functions dealing with stars list will be removed
--
To view, visit https://gerrit.wikimedia.org/r/606636
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I3d0bef6bb5876af8a7073bd487274c9df5ad10ed
Gerrit-Change-Number: 606636
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: jenkins-bot (75)
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/606176 )
Change subject: [IMPR] finally close sqlite connection using with statement
......................................................................
[IMPR] finally close sqlite connection using with statement
Change-Id: I021fb05b71c82fe67b9b3e5b1763c73d474aa3ba
---
M pywikibot/version.py
1 file changed, 9 insertions(+), 7 deletions(-)
Approvals:
Dvorapa: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/version.py b/pywikibot/version.py
index 3806e06..0c6423e 100644
--- a/pywikibot/version.py
+++ b/pywikibot/version.py
@@ -18,6 +18,7 @@
import time
import xml.dom.minidom
+from contextlib import closing
from distutils import log
from distutils.sysconfig import get_python_lib
from io import BytesIO
@@ -182,15 +183,16 @@
# We haven't found the information in entries file.
# Use sqlite table for new entries format
from sqlite3 import dbapi2 as sqlite
- con = sqlite.connect(os.path.join(_program_dir, '.svn/wc.db'))
- cur = con.cursor()
- cur.execute("""select
+ with closing(
+ sqlite.connect(os.path.join(_program_dir, '.svn/wc.db'))) as con:
+ cur = con.cursor()
+ cur.execute("""select
local_relpath, repos_path, revision, changed_date, checksum from nodes
order by revision desc, changed_date desc""")
- name, tag, rev, date, checksum = cur.fetchone()
- cur.execute('select root from repository')
- tag, = cur.fetchone()
- con.close()
+ name, tag, rev, date, checksum = cur.fetchone()
+ cur.execute('select root from repository')
+ tag, = cur.fetchone()
+
tag = os.path.split(tag)[1]
date = time.gmtime(date / 1000000)
return tag, rev, date
--
To view, visit https://gerrit.wikimedia.org/r/606176
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I021fb05b71c82fe67b9b3e5b1763c73d474aa3ba
Gerrit-Change-Number: 606176
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Dvorapa <dvorapa(a)seznam.cz>
Gerrit-Reviewer: jenkins-bot (75)