Skip to content
Snippets Groups Projects
  1. Oct 18, 2024
  2. Oct 11, 2024
    • Marc Troelitzsch's avatar
      test: replace pkg_resources with importlib.metadata for Python 3.8+ · 96ca94a1
      Marc Troelitzsch authored
      This change replaces the deprecated `pkg_resources` (part of
      `setuptools`) with `importlib.metadata` for Python 3.8 and above.
      
      Switching to `importlib.metadata` allows us to drop the test-dependency
      on `setuptools` and gets rid of the `DeprecationWarning` raised by
      certain versions of `pkg_resources` when being imported:
      
      ```
      DeprecationWarning: pkg_resources is deprecated as an API
      ```
      96ca94a1
  3. Sep 28, 2024
  4. Sep 05, 2024
  5. Aug 21, 2024
    • Marc Troelitzsch's avatar
      Refactor metaResponse method in test_client.py · c0809796
      Marc Troelitzsch authored
      Replaced the dynamic JSON string construction with a direct dictionary
      definition for namespaces.
      c0809796
    • Marc Troelitzsch's avatar
      refactor!: Use f-strings for string formatting · 658d5829
      Marc Troelitzsch authored
      This commit refactors the codebase to consistently use Python 3.6
      f-strings for string concatenation and interpolation.
      
      BREAKING CHANGE: This update increases the minimum required Python
      version from 3.5 to 3.6. Python 3.5 reached end-of-life in September
      2020 (~4 years ago) and has been dropped from most distributions, so the
      impact on users should be minimal.
      658d5829
    • Marc Troelitzsch's avatar
      refactor: Update some outdated syntax · 6eb48c47
      Marc Troelitzsch authored
      This commit updates some outdated syntax with the modern alternatives.
      The changes were applied automatically using pyupgrade (v2.0.1) with the
      following command:
      
      ```
      pyupgrade --py3-plus **/*.py
      ```
      
      These updates are purely syntactical and there should be no change in
      functionality.
      6eb48c47
  6. Aug 08, 2024
  7. Jul 17, 2024
  8. Jan 28, 2024
    • Marc Troelitzsch's avatar
      Remove some Python 2.x leftovers · 3f857829
      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
      3f857829
    • Adam Williamson's avatar
      HTTP basic auth: encode username and password as UTF-8 (#315) · a96baa9e
      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: default avatarAdam Williamson <awilliam@redhat.com>
      a96baa9e
  9. Jan 27, 2024
  10. Feb 25, 2023
    • Marc Troelitzsch's avatar
      #266: Add new Site.patrol function · 9359fd69
      Marc Troelitzsch authored
      9359fd69
    • Adam Williamson's avatar
      API calls: raise original exception when retries exhausted · 30b43690
      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: default avatarAdam Williamson <awilliam@redhat.com>
      30b43690
  11. Feb 10, 2023
  12. Sep 22, 2021
  13. May 28, 2020
  14. Aug 02, 2019
  15. Jan 11, 2018
  16. Nov 16, 2017
    • Adam Williamson's avatar
      Revert "Fix test compat with responses@0.6.0" · cd86bf35
      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.
      cd86bf35
  17. Jul 31, 2017
  18. May 17, 2017
  19. May 11, 2017
    • Dan Michael O. Heggø's avatar
      [#149] Fix login tokens for read protected wikis · 5701b57e
      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
      5701b57e
  20. Apr 28, 2017
  21. Nov 07, 2016
  22. Oct 23, 2016
  23. Jul 03, 2016
  24. Jan 10, 2016
  25. Nov 10, 2015
  26. Mar 15, 2015
Loading