Skip to content

Commit

Permalink
python312Packages.pdfminer-six: fix `TypeError: 'PDFObjRef' object is…
Browse files Browse the repository at this point in the history
… not iterable`

This fixes upstream issue
pdfminer/pdfminer.six#1004 and the build of
python3Packages.pdfplumber.
  • Loading branch information
dotlambda committed Sep 5, 2024
1 parent f7ef593 commit 5410e1e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkgs/development/python-modules/pdfminer-six/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
lib,
buildPythonPackage,
fetchFromGitHub,
fetchpatch2,
cryptography,
charset-normalizer,
pythonOlder,
Expand All @@ -26,6 +27,13 @@ buildPythonPackage rec {
};

patches = [
# https://github.com/pdfminer/pdfminer.six/pull/1027
(fetchpatch2 {
name = "fix-dereference-MediaBox.patch";
url = "https://github.com/pdfminer/pdfminer.six/pull/1027/commits/ad101c152c71431a21bfa5a8dbe33b3ba385ceec.patch?full_index=1";
excludes = [ "CHANGELOG.md" ];
hash = "sha256-fsSXvN92MVtNFpAst0ctvGrbxVvoe4Nyz4wMZqJ1aw8=";
})
(substituteAll {
src = ./disable-setuptools-git-versioning.patch;
inherit version;
Expand All @@ -52,6 +60,12 @@ buildPythonPackage rec {

nativeCheckInputs = [ pytestCheckHook ];

disabledTests = [
# The binary file samples/contrib/issue-1004-indirect-mediabox.pdf is
# stripped from fix-dereference-MediaBox.patch.
"test_contrib_issue_1004_mediabox"
];

passthru = {
tests = {
inherit ocrmypdf;
Expand Down

0 comments on commit 5410e1e

Please sign in to comment.