- Jul 17, 2024
-
-
Dylann Cordel authored
-
Dylann Cordel authored
* simple user creation * block user * unblock user * get basic info about user * get groups * add groups * remove groups * set groups (get current ones and add/remove what is needed)
-
- Jan 28, 2024
-
-
Marc Troelitzsch authored
* `Iterator.next()`` has been replaced with `Iterator.__next__()` * The `object.__unicode__()` method is not used anymore * Default source encoding has changed from ASCII to UTF-8
-
Adam Williamson authored
As discussed upstream in https://github.com/psf/requests/issues/4564 , HTTP basic auth usernames and passwords sent to requests as Python text strings are encoded as latin1. This of course makes it impossible to log in with a username or password containing characters not represented in latin1, as the reporter of #315 found out. To work around this rather old-fashioned default, let's intercept string usernames and passwords and encode them as utf-8 before sending them to requests. Anyone dealing with a really old server that can't handle utf-8, or something like that, can encode the username and password appropriately and provide them as bytestrings. Signed-off-by:
Adam Williamson <awilliam@redhat.com>
-
- Jan 27, 2024
-
-
Alexandre Detiste authored
-
- Feb 25, 2023
-
-
Marc Troelitzsch authored
-
Adam Williamson authored
This is an alternative approach to solve the problem identified in #279 . When doing API calls with `retry_on_error` set to true (the default), if the call fails after all retries are exhausted, we raise our own `MaximumRetriesExceeded` exception, which tells you nothing about what actually went wrong, just that we exhausted the retry count. It seems much more useful to raise an exception with information about why the connection is failing. This changes that behaviour so that, on most paths, we would raise an appropriate exception from requests (either the one we caught, or an HTTPError via `raise_for_status`) if we exhaust the retry count. Only if we fail due to database lag would we still raise `MaximumRetriesExceeded` (because there isn't really an underlying exception we can handily raise in that case). Note that it was already possible to hit `stream.raise_for_status()` before this change, if the status code was outside the 500 range, so in theory callers should already be prepared for that. It was not possible to get a `requests.exceptions.ConnectionError` or `requests.exceptions.Timeout` with `retry_on_error` true, though, so this is genuinely a behaviour change on that front. Signed-off-by:
Adam Williamson <awilliam@redhat.com>
-
- Feb 10, 2023
-
-
Adam Williamson authored
`clientlogin()` does `self.require(1, 27)`, which needs the site instance's `version` attribute to be set, but this is usually done by `site_init()`, which is mocked out in the tests. We can fix the problem by just manually setting a sufficiently high version in the tests. Signed-off-by:
Adam Williamson <awilliam@redhat.com>
-
- Sep 22, 2021
-
-
Dylann Cordel authored
-
- May 28, 2020
-
-
Håvard Flaget Aasen authored
-
Marc Trölitzsch authored
-
- Aug 02, 2019
-
-
Dan Michael O. Heggø authored
Breaking change: Change the `Site.ask()` method to produce less nested output. Basically, change `yield {title: answer}` to `yield answer`. The title is included in the answer object after all.
-
Dan Michael O. Heggø authored
-
Marc Trölitzsch authored
-
- Jan 11, 2018
-
-
Dan Michael O. Heggø authored
This fixes tests not being added to the source package.
-
- Nov 16, 2017
-
-
Adam Williamson authored
This reverts commit 1650e0e7. Upstream restored handling of the adding_headers arg in 0.6.1. Going back to using that name means we're still compatible with any version of responses after 0.3.0, except 0.6.0. Also adjust setup.py to express this correctly.
-
- Jul 31, 2017
-
-
Dan Michael O. Heggø authored
-
- May 17, 2017
-
-
Dan Michael O. Heggø authored
When there's zero results, the method should not yield an empty dictionary. Otherwise counting number of results could be wrong (think `len(list(site.ask('...')))`)
-
Dan Michael O. Heggø authored
-
- May 11, 2017
-
-
Dan Michael O. Heggø authored
On read protected wikis, we must make sure that we don't include extra parameters when requesting the login token, or we will get `readapideniederror`. - Remove extraneous `continue` parameter from non-query calls - Remove `userinfo` from `meta=tokens` calls
-
- Apr 28, 2017
-
-
Dan Michael O. Heggø authored
For MediaWiki >= 1.27, fetch login tokens from the tokens module using `action=query&meta=tokens`.
-
- Nov 07, 2016
-
-
Bryan Davis authored
Allow sending custom headers (e.g. X-Wikimedia-Debug) with all requests by passing a dict of header data in the Site constructor.
-
- Oct 23, 2016
-
-
Dan Michael O. Heggø authored
New implementation of #126
-
- Jul 03, 2016
-
-
Dan Michael O. Heggø authored
Add OAuth and update docs
-
Dan Michael O. Heggø authored
-
- Jan 10, 2016
-
-
Dan Michael O. Heggø authored
-
- Nov 10, 2015
-
-
Dan Michael O. Heggø authored
- Removing the need to use a double for loop to consume the the result by returning a list of revisions rather than a list of pages. - Parsing the timestamps using the standard parse_timestamp method - Adding tests (#84)
-
- Mar 15, 2015
-
-
Dan Michael O. Heggø authored
-
- Nov 23, 2014
-
-
Dan Michael O. Heggø authored
Prepare for Python 3.x support - Use print function - Use compability methods from six
-
- Nov 17, 2014
-
-
Dan Michael O. Heggø authored
- If database lag exceeds max lag, the API will still send 200, not 503. This was only added to documentation after bugzilla:31156. Ref. <https://www.mediawiki.org/wiki/Manual:Maxlag_parameter> - In addition, Requests doesn't raise an exception when status code != 200 unless raise_for_status() is called, so we should call that to catch any other 5xx errors such as Squid errors. - Replace print statements with logging Note that responses>=0.3.0 is needed to run the test suite now
-
Dan Michael O. Heggø authored
As suggested in #52 Original auth mechanism introduced in #27 This change should retain backwards compability
-
- Oct 26, 2014
-
-
Dan Michael O. Heggø authored
-
- Oct 05, 2014
-
-
Dan Michael O. Heggø authored
Use new token handling system described on https://www.mediawiki.org/wiki/API:Meta#tokens for MediaWiki >= 1.24
-
Dan Michael O. Heggø authored
Work in progress, looks a bit dirty right now
-
- Sep 21, 2014
-
-
Dan Michael O. Heggø authored
-
Dan Michael O. Heggø authored
Since we now require MediaWiki 1.16, these are no longer needed. It might be necessary to add new compability methods in the future, but the API is generally stable now.
-
- Sep 05, 2014
-
-
Waldir Pimenta authored
-
- Sep 04, 2014
-
-
Waldir Pimenta authored
-
- Sep 02, 2014
-
-
Dan Michael O. Heggø authored
- Require 'ordereddict' only on Python < 2.7 - Don't require 'simplejson'
-
- Aug 31, 2014
-
-
Dan Michael O. Heggø authored
- For some reason, 'pytest-cache' isn't found by setup.py if not specified explicitly in 'tests_require' - Add tox.ini so tests can be run using tox if desired - Update test to not be dependent on serialization
-