public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/thefuck] f45: apply upstream patch 1619
@ 2026-08-29 23:44 Filipe Rosset
0 siblings, 0 replies; only message in thread
From: Filipe Rosset @ 2026-08-29 23:44 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/thefuck
Branch : f45
Commit : 08e866e17d902b1d058abd43d2e878c12565a175
Author : Filipe Rosset <rosset.filipe@gmail.com>
Date : 2026-08-29T20:29:53-03:00
Stats : +100/-0 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/thefuck/c/08e866e17d902b1d058abd43d2e878c12565a175?branch=f45
Log:
apply upstream patch 1619
Resolves: rhbz#2510154
---
diff --git a/1619.patch b/1619.patch
new file mode 100644
index 0000000..1bd5c5d
--- /dev/null
+++ b/1619.patch
@@ -0,0 +1,97 @@
+Subject: [PATCH] fix: Python 3.12+ compatibility - replace deprecated imp
+ module
+
+This commit fixes a critical compatibility issue preventing thefuck
+from running on Python 3.12 and later versions.
+
+Changes:
+- Replace imp.load_source() with importlib.util (imp removed in Python 3.12)
+- Remove six dependency from conf.py
+- Update python_requires to >=3.8
+- Simplify extras_require by removing Python 2.x conditions
+
+Test results:
+- Original: 77 passed, 2 warnings
+- Patched: 77 passed, 2 warnings
+- No regressions introduced
+
+Fixes #1501, #1608
+---
+ setup.py | 10 ++++------
+ thefuck/conf.py | 23 +++++++++++++----------
+ 2 files changed, 17 insertions(+), 16 deletions(-)
+
+diff --git a/setup.py b/setup.py
+index 1105aef49..7c77a5038 100755
+--- a/setup.py
++++ b/setup.py
+@@ -33,10 +33,8 @@ elif (3, 0) < version < (3, 5):
+
+ VERSION = '3.32'
+
+-install_requires = ['psutil', 'colorama', 'six', 'decorator', 'pyte']
+-extras_require = {':python_version<"3.4"': ['pathlib2'],
+- ':python_version<"3.3"': ['backports.shutil_get_terminal_size'],
+- ':python_version<="2.7"': ['decorator<5'],
++install_requires = ['psutil>=5.0', 'colorama>=0.4', 'decorator>=4.0', 'pyte>=0.8.0', 'six']
++extras_require = {
+ ":sys_platform=='win32'": ['win_unicode_console']}
+
+ setup(name='thefuck',
+@@ -51,7 +49,7 @@ setup(name='thefuck',
+ 'tests', 'tests.*', 'release']),
+ include_package_data=True,
+ zip_safe=False,
+- python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*',
++ python_requires='>=3.8',
+ install_requires=install_requires,
+ extras_require=extras_require,
+ entry_points={'console_scripts': [
+diff --git a/thefuck/conf.py b/thefuck/conf.py
+index 611ec84b7..1b4b0257f 100644
+--- a/thefuck/conf.py
++++ b/thefuck/conf.py
+@@ -1,20 +1,23 @@
+ import os
+ import sys
+ from warnings import warn
+-from six import text_type
+ from . import const
+ from .system import Path
+
+-try:
+- import importlib.util
+-
+- def load_source(name, pathname, _file=None):
+- module_spec = importlib.util.spec_from_file_location(name, pathname)
+- module = importlib.util.module_from_spec(module_spec)
+- module_spec.loader.exec_module(module)
+- return module
+-except ImportError:
+- from imp import load_source
++# Python 3.12+ compatibility: imp module removed in 3.12
++# Using importlib.util exclusively (available since Python 3.4)
++import importlib.util
++
++def load_source(name, pathname, _file=None):
++ """Load a Python source file as a module.
++
++ Uses importlib.util instead of deprecated imp module.
++ Compatible with Python 3.12, 3.13, 3.14+.
++ """
++ module_spec = importlib.util.spec_from_file_location(name, pathname)
++ module = importlib.util.module_from_spec(module_spec)
++ module_spec.loader.exec_module(module)
++ return module
+
+
+ class Settings(dict):
+@@ -77,7 +80,7 @@ class Settings(dict):
+ def _settings_from_file(self):
+ """Loads settings from file."""
+ settings = load_source(
+- 'settings', text_type(self.user_dir.joinpath('settings.py')))
++ 'settings', str(self.user_dir.joinpath('settings.py')))
+ return {key: getattr(settings, key)
+ for key in const.DEFAULT_SETTINGS.keys()
+ if hasattr(settings, key)}
diff --git a/thefuck.spec b/thefuck.spec
index f6de24a..56ba6bf 100644
--- a/thefuck.spec
+++ b/thefuck.spec
@@ -15,6 +15,9 @@ Patch0: thefuck-support-python-3.11.patch
Patch1: thefuck-fix-pytest8.patch
# https://github.com/nvbn/thefuck/pull/1437
Patch2: thefuck-replace-mock.patch
+# Fix Python 3.12+ compatibility: replace deprecated imp module
+# https://github.com/nvbn/thefuck/pull/1619
+Patch4: https://patch-diff.githubusercontent.com/raw/nvbn/thefuck/pull/1619.patch
BuildArch: noarch
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-29 23:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-29 23:44 [rpms/thefuck] f45: apply upstream patch 1619 Filipe Rosset
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox