From c6606136d7d2b7a723eef9148485f3ee0f175c06 Mon Sep 17 00:00:00 2001 From: Bad3r <25513724+Bad3r@users.noreply.github.com> Date: Mon, 4 May 2026 15:03:18 +0300 Subject: [PATCH] python3Packages.wfuzz: fix screenshot plugin on Python 3.13 `pipes` was deprecated in Python 3.11 (PEP 594) and removed in 3.13; src/wfuzz/plugins/scripts/screenshot.py imports it and fails to load on 3.13 with `No module named 'pipes'`. The module loader catches the ImportError and silently drops the plugin, so `wfuzz -e scripts` no longer lists `screenshot`. Replace `pipes.quote` with `shlex.quote` (the documented stdlib replacement; identical semantics for the single argument used here). Reported upstream at xmendez/wfuzz#380. --- .../python-modules/wfuzz/default.nix | 3 ++ .../wfuzz/python-313-shlex.patch | 29 +++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 pkgs/development/python-modules/wfuzz/python-313-shlex.patch diff --git a/pkgs/development/python-modules/wfuzz/default.nix b/pkgs/development/python-modules/wfuzz/default.nix index 5df717c8b4da..63ea5c81adcf 100644 --- a/pkgs/development/python-modules/wfuzz/default.nix +++ b/pkgs/development/python-modules/wfuzz/default.nix @@ -35,6 +35,9 @@ buildPythonPackage (finalAttrs: { url = "https://github.com/xmendez/wfuzz/commit/f4c028b9ada4c36dabf3bc752f69f6ddc110920f.patch?full_index=1"; hash = "sha256-t7pUMcdFmwAsGUNBRdZr+Jje/yR0yzeGIgeYNEq4hFE="; }) + # replace removed `pipes` stdlib module with `shlex` for Python >= 3.13 + # https://github.com/xmendez/wfuzz/issues/380 + ./python-313-shlex.patch ]; build-system = [ setuptools ]; diff --git a/pkgs/development/python-modules/wfuzz/python-313-shlex.patch b/pkgs/development/python-modules/wfuzz/python-313-shlex.patch new file mode 100644 index 000000000000..a55bac99493b --- /dev/null +++ b/pkgs/development/python-modules/wfuzz/python-313-shlex.patch @@ -0,0 +1,29 @@ +Replace removed `pipes` stdlib module with `shlex` in screenshot plugin. + +`pipes` was deprecated in Python 3.11 (PEP 594) and removed in 3.13; +`shlex.quote` is the documented stdlib replacement and behaves identically +for the single argument used here. + +Reported upstream: https://github.com/xmendez/wfuzz/issues/380 + +diff --git a/src/wfuzz/plugins/scripts/screenshot.py b/src/wfuzz/plugins/scripts/screenshot.py +--- a/src/wfuzz/plugins/scripts/screenshot.py ++++ b/src/wfuzz/plugins/scripts/screenshot.py +@@ -3,7 +3,7 @@ from wfuzz.externals.moduleman.plugin import moduleman_plugin + + import subprocess + import tempfile +-import pipes ++import shlex + import os + import re + +@@ -42,7 +42,7 @@ class screenshot(BasePlugin): + subprocess.call( + [ + "cutycapt", +- "--url=%s" % pipes.quote(fuzzresult.url), ++ "--url=%s" % shlex.quote(fuzzresult.url), + "--out=%s" % filename, + "--insecure", + "--print-backgrounds=on",