Compare commits
6 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| aba7b996d3 | |||
| 74a6fc6fdc | |||
| 6e80026855 | |||
| cd6b470baa | |||
| 77e70f2717 | |||
| 487f5a9eaa |
@@ -1,32 +0,0 @@
|
|||||||
From 412479e5d6b02f7dd7e20f870132a413dc83898a Mon Sep 17 00:00:00 2001
|
|
||||||
From: Doyle Rowland <doyle.rowland@reliaqual.com>
|
|
||||||
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:
|
|
||||||
@@ -1,8 +1,3 @@
|
|||||||
-------------------------------------------------------------------
|
|
||||||
Fri Nov 14 13:51:14 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
|
||||||
|
|
||||||
- Add upstream ignore-utf16.patch to fix test failure
|
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon May 19 10:01:24 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
|
Mon May 19 10:01:24 UTC 2025 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-docformatter
|
# spec file for package python-docformatter
|
||||||
#
|
#
|
||||||
# Copyright (c) 2025 SUSE LLC and contributors
|
# Copyright (c) 2025 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -26,8 +26,6 @@ URL: https://github.com/myint/docformatter
|
|||||||
Source: https://github.com/PyCQA/docformatter/archive/refs/tags/v%{version}.tar.gz#/docformatter-%{version}.tar.gz
|
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
|
# PATCH-FIX-OPENSUSE Do not require virtualenvs to run the tests
|
||||||
Patch0: do-not-require-venv.patch
|
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 base >= 3.7}
|
||||||
BuildRequires: %{python_module pip}
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module poetry-core}
|
BuildRequires: %{python_module poetry-core}
|
||||||
|
|||||||
Reference in New Issue
Block a user