Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛 Bug]: Some tests in py/test/selenium/webdriver using 'dead battery' library imghdr #14765

Closed
tijuca opened this issue Nov 17, 2024 · 2 comments · Fixed by #14771
Closed

Comments

@tijuca
Copy link

tijuca commented Nov 17, 2024

What happened?

Not a really bug report, just to mentioning an potential upcoming incompatibility.

The Debian Python Team discovered that several upstream project tarballs, which are used as base for building Debian packages, still use some modules that are not being available in Python 3.13+ anymore.

The tests
https://github.com/SeleniumHQ/selenium/blob/trunk/py/test/selenium/webdriver/common/takes_screenshots_tests.py#L19
https://github.com/SeleniumHQ/selenium/blob/trunk/py/test/selenium/webdriver/firefox/ff_takes_full_page_screenshots_tests.py#L19
https://github.com/SeleniumHQ/selenium/blob/trunk/py/test/selenium/webdriver/remote/remote_connection_tests.py#L18

using the imghdr module, that will be a so called dead battery starting with Python 3.13. https://peps.python.org/pep-0594/#deprecated-modules

The tests will need some rework to be functional with 3.13+

The related bug report in Debian is https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1084692

How can we reproduce the issue?

n.a.

Relevant log output

n.a.

Operating System

Debian 13 Trixie

Selenium version

Python 4.24.4

What are the browser(s) and version(s) where you see this issue?

n.a.

What are the browser driver(s) and version(s) where you see this issue?

n.a.

Are you using Selenium Grid?

No response

Copy link

@tijuca, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@navin772
Copy link
Contributor

Thanks @tijuca for reporting this, I will discuss with the TLC on what new dependency to use and open a PR for the same.

Possible alternatives:

  • python-magic - it has an external dep - libmagic
  • filetype - lightweight, deps free
  • puremagic
  • Pillow - large and overkill for the use-case

Personally, I think filetype is great for the current use-case.

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

Successfully merging a pull request may close this issue.

2 participants