From 3067b812d5913671f4cd4741f59a2431b8edbf32 Mon Sep 17 00:00:00 2001 From: XANTRONIX Development Date: Wed, 4 Dec 2024 22:25:48 -0500 Subject: [PATCH] Fix NEWNEWS --- lib/nntp/tiny/session.py | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/nntp/tiny/session.py b/lib/nntp/tiny/session.py index 4ac2fcf..7633fab 100644 --- a/lib/nntp/tiny/session.py +++ b/lib/nntp/tiny/session.py @@ -400,7 +400,9 @@ class Session(Connection): match = self.RE_DATE_SHORT.match(datestr) if match: - yy, mm, dd = map(int, match[1:3]) + yy = int(match[1]) + mm = int(match[2]) + dd = int(match[3]) if yy >= 70: yyyy = 1900 + yy @@ -409,7 +411,9 @@ class Session(Connection): match = self.RE_DATE_LONG.match(datestr) if match: - yyyy, mm, dd = map(int, match[1:3]) + yyyy = int(match[1]) + mm = int(match[2]) + dd = int(match[3]) if yyyy is None: return @@ -418,7 +422,9 @@ class Session(Connection): if match is None: return - hh, mm, ss = map(int, match[1:3]) + hh = int(match[1]) + MM = int(match[2]) + ss = int(match[3]) return datetime.datetime(yyyy, mm, dd, hh, MM, ss) @@ -458,8 +464,13 @@ class Session(Connection): cr = self.db.execute(sql, (newsgroup.id, timestamp.isoformat())) - for row in cr.each(): - self.print(row[0]) + while True: + row = cr.fetchone() + + if row is None: + break + + self.print(str(row[0])) return self.end()