public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Filipe Rosset <rosset.filipe@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/thefuck] rawhide: apply upstream patch 1619
Date: Sat, 29 Aug 2026 23:41:14 GMT	[thread overview]
Message-ID: <178804687432.1.15585379488741381631.rpms-thefuck-08e866e17d90@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/thefuck
            Branch : rawhide
            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=rawhide

            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
 

                 reply	other threads:[~2026-08-29 23:41 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=178804687432.1.15585379488741381631.rpms-thefuck-08e866e17d90@fedoraproject.org \
    --to=rosset.filipe@gmail.com \
    --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