Skip to content

Conversation

@thunze
Copy link
Member

@thunze thunze commented Nov 27, 2025

lxml 6 doesn't find a <body> tag via the XPath expression //body anymore when the parsed HTML doesn't contain any tags at all. This causes some of splinter's tests to fail when lxml 6 is used.

The lxml HTML parser generally seems to behave rather erratically when there is no <body> tag in the parsed HTML, so consumers probably shouldn't rely on this behavior anyway.

Upstream patch: cobrateam/splinter#1334

Hydra: https://hydra.nixos.org/build/314264704/nixlog/1
ZHF: #457852

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@thunze thunze added 0.kind: ZHF Fixes Fixes during the Zero Hydra Failures (ZHF) campaign backport release-25.11 Backport PR automatically labels Nov 27, 2025
@thunze thunze marked this pull request as draft November 27, 2025 19:41
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 6.topic: python Python is a high-level, general-purpose programming language. labels Nov 27, 2025
@thunze
Copy link
Member Author

thunze commented Nov 27, 2025

Initially I thought the latest unstable commit would fix the tests that are currently failing, but it seems upstream just restructured how they run tests for different drivers (they introduced a --browser flag). I need to give this some more thought.

@thunze
Copy link
Member Author

thunze commented Nov 28, 2025

lmxl 6 seems to be the culprit.

The tests fail because something like lxml.html.fromstring("BAR!").xpath("//body") doesn't find a <body> element anymore.

@thunze thunze changed the title python313Packages.splinter: 0.21.0 -> 0.21.0-unstable-2025-08-16 python313Packages.splinter: fix build with lxml 6 Nov 28, 2025
lxml 6 doesn't find a `<body>` tag via the XPath expression `//body`
anymore when the parsed HTML doesn't contain any tags at all. This
causes some of splinter's tests to fail when lxml 6 is used.
@thunze thunze force-pushed the splinter-0.21.0-unstable-2025-08-16 branch from 1290143 to 98d1634 Compare November 28, 2025 23:11
@thunze thunze marked this pull request as ready for review November 28, 2025 23:43
@nixpkgs-ci nixpkgs-ci bot requested a review from dotlambda November 28, 2025 23:50
@dotlambda
Copy link
Member

Is there an upstream issue/PR about these test failures? Maybe it would be easier to just disable the specific tests?

@thunze
Copy link
Member Author

thunze commented Nov 29, 2025

Is there an upstream issue/PR about these test failures?

Not yet. But I'm gonna create one when I find the time.

Maybe it would be easier to just disable the specific tests?

I'd be fine with that, too. I took some time to find the underlying reason for the failures, so I figured why not just write a patch. Your call though. :)

@dotlambda
Copy link
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 465719
Commit: 98d16344238dbadaf22e92727efe030f2b524820


x86_64-linux

✅ 4 packages built:
  • python312Packages.splinter
  • python312Packages.splinter.dist
  • python313Packages.splinter
  • python313Packages.splinter.dist

@dotlambda dotlambda added this pull request to the merge queue Nov 29, 2025
Merged via the queue into NixOS:master with commit 7f8ccd8 Nov 29, 2025
33 of 35 checks passed
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Nov 29, 2025

Successfully created backport PR for release-25.11:

@github-actions github-actions bot added the 8.has: port to stable This PR already has a backport to the stable release. label Nov 29, 2025
@thunze thunze deleted the splinter-0.21.0-unstable-2025-08-16 branch November 29, 2025 21:39
@thunze
Copy link
Member Author

thunze commented Nov 29, 2025

Thanks!

Upstream patch for future reference: cobrateam/splinter#1334

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.kind: ZHF Fixes Fixes during the Zero Hydra Failures (ZHF) campaign 6.topic: python Python is a high-level, general-purpose programming language. 8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. backport release-25.11 Backport PR automatically

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants