public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/sync/, /
@ 2025-07-04  5:14 Arthur Zamarin
  0 siblings, 0 replies; 2+ messages in thread
From: Arthur Zamarin @ 2025-07-04  5:14 UTC (permalink / raw
  To: gentoo-commits

commit:     3808311dfeb62c2297e03b78014168573cfa61b7
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Jul  4 05:13:24 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Jul  4 05:13:24 2025 +0000
URL:        https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=3808311d

rsync: fix SyntaxWarning when using Python 3.14

Thanks-to: Brian Harring <ferringb <AT> gmail.com>
Resolves: https://github.com/pkgcore/pkgcore/issues/448
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 NEWS.rst                  |  2 ++
 src/pkgcore/sync/rsync.py | 32 +++++++++++++++-----------------
 2 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/NEWS.rst b/NEWS.rst
index 8cc97eed..b64489d1 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -11,6 +11,8 @@ pkgcore 0.12.31 (????-??-??)
 
 - rsync: fix logical bug with negative sync delta (Arthur Zamarin)
 
+- rsync: fix SyntaxWarning when using Python 3.14 (Arthur Zamarin, #448)
+
 ----------------------------
 pkgcore 0.12.30 (2025-06-02)
 ----------------------------

diff --git a/src/pkgcore/sync/rsync.py b/src/pkgcore/sync/rsync.py
index 8f470b9f..7c9aa243 100644
--- a/src/pkgcore/sync/rsync.py
+++ b/src/pkgcore/sync/rsync.py
@@ -228,22 +228,20 @@ class rsync_timestamp_syncer(rsync_syncer):
             # force a reset of the timestamp
             self.last_timestamp = self.current_timestamp()
         finally:
-            if ret:
-                return ret
-            # ensure the timestamp is back to the old
-            try:
-                timestamp_path = pjoin(self.basedir, "metadata", "timestamp.chk")
-                if self.last_timestamp is None:
-                    os.remove(timestamp_path)
-                else:
-                    with open(timestamp_path, "w") as f:
-                        f.write(
-                            time.strftime(
-                                "%a, %d %b %Y %H:%M:%S +0000",
-                                time.gmtime(self.last_timestamp),
+            if not ret:
+                # ensure the timestamp is back to the old
+                try:
+                    timestamp_path = pjoin(self.basedir, "metadata", "timestamp.chk")
+                    if self.last_timestamp is None:
+                        os.remove(timestamp_path)
+                    else:
+                        with open(timestamp_path, "w") as f:
+                            f.write(
+                                time.strftime(
+                                    "%a, %d %b %Y %H:%M:%S +0000",
+                                    time.gmtime(self.last_timestamp),
+                                )
                             )
-                        )
-            except EnvironmentError:
-                # don't care...
-                pass
+                except EnvironmentError:
+                    pass  # don't care...
         return ret


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/sync/, /
@ 2025-07-04  5:14 Arthur Zamarin
  0 siblings, 0 replies; 2+ messages in thread
From: Arthur Zamarin @ 2025-07-04  5:14 UTC (permalink / raw
  To: gentoo-commits

commit:     6edcd37b0c8514a5b7c9d9c5600194caa1049be8
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Thu Jul  3 16:46:59 2025 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Thu Jul  3 16:49:08 2025 +0000
URL:        https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=6edcd37b

rsync: fix computing of current timestamp with timezone offset

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 NEWS.rst                  | 7 +++++++
 src/pkgcore/sync/rsync.py | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/NEWS.rst b/NEWS.rst
index 7c4e4be9..eef5e6ef 100644
--- a/NEWS.rst
+++ b/NEWS.rst
@@ -2,6 +2,13 @@
 Release Notes
 =============
 
+----------------------------
+pkgcore 0.12.31 (????-??-??)
+----------------------------
+
+- rsync: fix bug in computing the current timestamp when the timezone is not
+  UTC (Arthur Zamarin)
+
 ----------------------------
 pkgcore 0.12.30 (2025-06-02)
 ----------------------------

diff --git a/src/pkgcore/sync/rsync.py b/src/pkgcore/sync/rsync.py
index 4869ac6a..6c2e81d7 100644
--- a/src/pkgcore/sync/rsync.py
+++ b/src/pkgcore/sync/rsync.py
@@ -193,7 +193,7 @@ class rsync_timestamp_syncer(rsync_syncer):
                 date, offset = f.read().strip().rsplit("+", 1)
             date = time.mktime(time.strptime(date, "%a, %d %b %Y %H:%M:%S "))
             # add the hour/minute offset
-            date += int(offset[:2] * 60) + int(offset[2:])
+            date += int(offset[:2]) * 60 + int(offset[2:])
             return date
         except (FileNotFoundError, NotADirectoryError):
             return None


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-07-04  5:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-04  5:14 [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/sync/, / Arthur Zamarin
  -- strict thread matches above, loose matches on Subject: below --
2025-07-04  5:14 Arthur Zamarin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox