Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-docformatter for 
openSUSE:Factory checked in at 2025-11-17 12:19:58
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-docformatter (Old)
 and      /work/SRC/openSUSE:Factory/.python-docformatter.new.2061 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-docformatter"

Mon Nov 17 12:19:58 2025 rev:12 rq:1318159 version:1.7.7

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-docformatter/python-docformatter.changes  
2025-05-20 17:04:14.057837745 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-docformatter.new.2061/python-docformatter.changes
        2025-11-17 12:25:42.419661689 +0100
@@ -1,0 +2,5 @@
+Fri Nov 14 13:51:14 UTC 2025 - Markéta Machová <[email protected]>
+
+- Add upstream ignore-utf16.patch to fix test failure
+
+-------------------------------------------------------------------

New:
----
  ignore-utf16.patch

----------(New B)----------
  New:
- Add upstream ignore-utf16.patch to fix test failure
----------(New E)----------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-docformatter.spec ++++++
--- /var/tmp/diff_new_pack.aw7jtR/_old  2025-11-17 12:25:43.243696439 +0100
+++ /var/tmp/diff_new_pack.aw7jtR/_new  2025-11-17 12:25:43.247696607 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-docformatter
 #
-# Copyright (c) 2025 SUSE LLC
+# Copyright (c) 2025 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -26,6 +26,8 @@
 Source:         
https://github.com/PyCQA/docformatter/archive/refs/tags/v%{version}.tar.gz#/docformatter-%{version}.tar.gz
 # PATCH-FIX-OPENSUSE Do not require virtualenvs to run the tests
 Patch0:         do-not-require-venv.patch
+# PATCH-FIX-UPSTREAM cherry-pick from 
https://github.com/PyCQA/docformatter/pull/323 fix: issue 321
+Patch1:         ignore-utf16.patch
 BuildRequires:  %{python_module base >= 3.7}
 BuildRequires:  %{python_module pip}
 BuildRequires:  %{python_module poetry-core}

++++++ ignore-utf16.patch ++++++
>From 412479e5d6b02f7dd7e20f870132a413dc83898a Mon Sep 17 00:00:00 2001
From: Doyle Rowland <[email protected]>
Date: Thu, 14 Aug 2025 17:58:02 -0400
Subject: [PATCH] fix: explicitly ignore utf_16 and utf_32 encoding

---
 src/docformatter/encode.py | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/docformatter/encode.py b/src/docformatter/encode.py
index ac55ee9..c7e36f0 100644
--- a/src/docformatter/encode.py
+++ b/src/docformatter/encode.py
@@ -64,9 +64,15 @@ def do_detect_encoding(self, filename) -> None:
         """
         try:
             detection_result = from_path(filename).best()
-            self.encoding = (
-                detection_result.encoding if detection_result else 
self.DEFAULT_ENCODING
-            )
+            if detection_result and detection_result.encoding in ["utf_16", 
"utf_32"]:
+                # Treat undetectable/binary encodings as failure
+                self.encoding = self.DEFAULT_ENCODING
+            else:
+                self.encoding = (
+                    detection_result.encoding
+                    if detection_result
+                    else self.DEFAULT_ENCODING
+                )
 
             # Check for correctness of encoding.
             with self.do_open_with_encoding(filename) as check_file:

Reply via email to