public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Dick Marinus <dick@mrns.nl>
To: git-commits@fedoraproject.org
Subject: [rpms/alot] rawhide: sys.stderr replace mock with io.StringIO
Date: Mon, 08 Jun 2026 17:35:53 GMT	[thread overview]
Message-ID: <178094015380.1.5483365079572974492.rpms-alot-e320edc45e63@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/alot
Branch : rawhide
Commit : e320edc45e63ef848853434eb7f0c98a7b728400
Author : Dick Marinus <dick@mrns.nl>
Date   : 2026-06-07T20:20:20+02:00
Stats  : +43/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/alot/c/e320edc45e63ef848853434eb7f0c98a7b728400?branch=rawhide

Log:
sys.stderr replace mock with io.StringIO

---
diff --git a/0001-sys.stderr-replace-mock-with-io.StringIO.patch b/0001-sys.stderr-replace-mock-with-io.StringIO.patch
new file mode 100644
index 0000000..f82acd9
--- /dev/null
+++ b/0001-sys.stderr-replace-mock-with-io.StringIO.patch
@@ -0,0 +1,38 @@
+From 9b6d876f670356c8a2e2187b30ed4dcebb36fdb7 Mon Sep 17 00:00:00 2001
+From: Dick Marinus <dick@mrns.nl>
+Date: Sun, 10 May 2026 13:55:45 +0200
+Subject: [PATCH 01/12] sys.stderr replace mock with io.StringIO
+
+Python 3.15 does some formatting on sys.stderr for argparse and this
+doesn't work with a Mock object (it tries call fileno and expects an
+integer).
+
+Use io.StringIO instead, I think it's only used for supressing stderr.
+---
+ tests/utils/test_argparse.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tests/utils/test_argparse.py b/tests/utils/test_argparse.py
+index c91f0a75..d8bed9cd 100644
+--- a/tests/utils/test_argparse.py
++++ b/tests/utils/test_argparse.py
+@@ -23,6 +23,7 @@ import shutil
+ import tempfile
+ import unittest
+ from unittest import mock
++import io
+ 
+ from alot.utils import argparse as cargparse
+ 
+@@ -50,7 +51,7 @@ class TestValidatedStore(unittest.TestCase):
+             'foo',
+             action=cargparse.ValidatedStoreAction,
+             validator=validator)
+-        with mock.patch('sys.stderr', mock.Mock()):
++        with mock.patch('sys.stderr', io.StringIO()):
+             return parser.parse_args(args)
+ 
+     def test_validates(self):
+-- 
+2.54.0
+

diff --git a/alot.spec b/alot.spec
index 27a5d80..dd036c8 100644
--- a/alot.spec
+++ b/alot.spec
@@ -1,6 +1,6 @@
 Name:           alot
 Version:        0.12
-Release:        5%{?dist}
+Release:        6%{?dist}
 Summary:        Experimental terminal MUA based on notmuch mail
 
 # Automatically converted from old format: GPLv3+ - review is highly recommended.
@@ -9,6 +9,7 @@ URL:            https://github.com/pazz/alot
 Source:         %{url}/archive/refs/tags/v%{version}.tar.gz
 Patch:          0001-replace-python-magic-with-file-magic.patch
 Patch:          0001-Replace-glob1-with-glob.patch
+Patch:          0001-sys.stderr-replace-mock-with-io.StringIO.patch
 
 BuildArch:      noarch
 
@@ -54,6 +55,9 @@ install -Dpm0644 alot/defaults/* -t %{buildroot}/%{python3_sitelib}/alot/default
 %{_mandir}/man1/alot.1*
 
 %changelog
+* Sun Jun  7 2026 Dick Marinus <dick@mrns.nl> - 0.12.6
+- sys.stderr replace mock with io.StringIO
+
 * Thu Jun 04 2026 Python Maint <python-maint@redhat.com> - 0.12-5
 - Rebuilt for Python 3.15
 

                 reply	other threads:[~2026-06-08 17:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178094015380.1.5483365079572974492.rpms-alot-e320edc45e63@fedoraproject.org \
    --to=dick@mrns.nl \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox