#3664 Recreate timeouted session
Merged by tkopecek. Opened by tkopecek.
tkopecek/koji pr3543b  into  master

Download 3664.patch

3543 with additonal changes, see discussion in #3543

Fixing #3394

rebased onto 19987b174aa6f4090136f0e9d1973fef454e501a

2 new commits added

  • fix tests
  • fix decorator

Metadata Update from @tkopecek:
- Pull-request tagged with: testing-ready

This syntax is not supported by py2. Auth.py could be installed on py2 instances.

This syntax is not supported by py2. Auth.py could be installed on py2 instances.

fstring is not supported by py2. Auth.py could be installed on py2 instances.

fstring is not supported by py2. Auth.py could be installed on py2 instances.

It is a server-side module, so it is always py3. What we should do is to move it to hub subpackage. But that's for another PR.

1 new commit added

  • remove f-strings for py2 compatibility

rebased onto 3a812535906484e1534761edab3fc2c8b88555a3

I'm confused by this commit

commit 40780155a228326c9b950b71a1509003b56bead8 (HEAD -> pagure/pr/3664)
Author: Tomas Kopecek <tkopecek@redhat.com>
Date:   Wed Jan 25 15:23:33 2023 +0100
    remove staticmethod due to py2.7 compatibility
diff --git a/koji/__init__.py b/koji/__init__.py
index 5dbd8535..70354b48 100644
--- a/koji/__init__.py
+++ b/koji/__init__.py
@@ -2911,7 +2911,6 @@ class ClientSession(object):
         self.logged_in = False
         auth_method(*args, **kwargs)
-    @staticmethod
     def renew_expired_session(func):
         """Decorator to renew expirated session or subsession."""
         def _renew_expired_session(self, *args, **kwargs):

AFAICT, using staticmethod as a decorator is supported in 2.7. I think you'd have to go much further back to lose that (and even if you did, you'd just switch to using the function invocation for staticmethod).

It has a different behaviour in 2.7 and 3.x. In 2.7 I'll get unbound call aka "TypeError: 'staticmethod' object is not callable" while in 3.x it works as expected. Just removing staticmethod works. I was a bit inclined to rip it out of the class completely to be clear with its "staticness".

Metadata Update from @mfilip:
- Pull-request tagged with: testing-done

Commit d5ed48f5 fixes this pull-request

Pull-Request has been merged by tkopecek

Metadata