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

Fix deprecated calls to guess_type for paths with Python 3.13 #10102

Merged
merged 6 commits into from
Dec 4, 2024

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Dec 4, 2024

What do these changes do?

https://docs.python.org/3/library/mimetypes.html#mimetypes.guess_type

Deprecated since version 3.13: Passing a file path instead of URL is soft deprecated. Use guess_file_type() for this.

These should have been changed to guess_file_type on Python 3.13 as guess_type expects a URL and guess_file_type expects a path. Its a soft deprecation so they still work but that may change in the future.

Are there changes in behavior for the user?

no

Is it a substantial burden for the maintainers to support this?

no

This should have been a call to guess_file_type as guess_type expects
a URL and guess_file_type expects a path
@bdraco bdraco added backport-3.11 Trigger automatic backporting to the 3.11 release branch by Patchback robot backport-3.12 Trigger automatic backporting to the 3.12 release branch by Patchback robot labels Dec 4, 2024
Copy link

codecov bot commented Dec 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.76%. Comparing base (fcce1bf) to head (381da37).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #10102   +/-   ##
=======================================
  Coverage   98.76%   98.76%           
=======================================
  Files         122      122           
  Lines       36904    36912    +8     
  Branches     4400     4402    +2     
=======================================
+ Hits        36447    36455    +8     
  Misses        311      311           
  Partials      146      146           
Flag Coverage Δ
CI-GHA 98.64% <80.00%> (-0.01%) ⬇️
OS-Linux 98.33% <80.00%> (-0.01%) ⬇️
OS-Windows 96.18% <80.00%> (-0.01%) ⬇️
OS-macOS 96.91% <60.00%> (-0.54%) ⬇️
Py-3.10.11 95.74% <60.00%> (-1.55%) ⬇️
Py-3.10.15 97.82% <60.00%> (-0.07%) ⬇️
Py-3.11.10 97.86% <60.00%> (-0.02%) ⬇️
Py-3.11.9 95.78% <60.00%> (-1.56%) ⬇️
Py-3.12.7 98.36% <60.00%> (-0.04%) ⬇️
Py-3.13.0 98.36% <60.00%> (-0.04%) ⬇️
Py-3.9.13 97.20% <60.00%> (-0.02%) ⬇️
Py-3.9.20 97.78% <60.00%> (-0.02%) ⬇️
Py-pypy7.3.16 97.35% <60.00%> (-0.02%) ⬇️
VM-macos 96.91% <60.00%> (-0.54%) ⬇️
VM-ubuntu 98.33% <80.00%> (-0.01%) ⬇️
VM-windows 96.18% <80.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bdraco bdraco changed the title Fix incorrect call to guess_type in FileResponse Fix deprecated call to guess_type in FileResponse for Python 3.13 Dec 4, 2024
@bdraco bdraco changed the title Fix deprecated call to guess_type in FileResponse for Python 3.13 Fix deprecated call to guess_type in FileResponse for Python 3.13 Dec 4, 2024
Copy link

codspeed-hq bot commented Dec 4, 2024

CodSpeed Performance Report

Merging #10102 will not alter performance

Comparing wrong_call_to_mime_types (381da37) with master (fcce1bf)

Summary

✅ 46 untouched benchmarks

@bdraco bdraco changed the title Fix deprecated call to guess_type in FileResponse for Python 3.13 Fix deprecated call to guess_type for paths with Python 3.13 Dec 4, 2024
@bdraco bdraco changed the title Fix deprecated call to guess_type for paths with Python 3.13 Fix deprecated calls to guess_type for paths with Python 3.13 Dec 4, 2024
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Dec 4, 2024
CHANGES/10102.bugfix.rst Outdated Show resolved Hide resolved
@bdraco bdraco closed this Dec 4, 2024
@bdraco bdraco reopened this Dec 4, 2024
@bdraco bdraco marked this pull request as ready for review December 4, 2024 19:08
@bdraco bdraco merged commit 7557b03 into master Dec 4, 2024
45 of 73 checks passed
@bdraco bdraco deleted the wrong_call_to_mime_types branch December 4, 2024 19:20
Copy link
Contributor

patchback bot commented Dec 4, 2024

Backport to 3.11: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.11/7557b03da53a51a21dbd66ee8206755fdcd0d728/pr-10102

Backported as #10103

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

Copy link
Contributor

patchback bot commented Dec 4, 2024

Backport to 3.12: 💚 backport PR created

✅ Backport PR branch: patchback/backports/3.12/7557b03da53a51a21dbd66ee8206755fdcd0d728/pr-10102

Backported as #10104

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Dec 4, 2024
bdraco added a commit that referenced this pull request Dec 4, 2024
…pe` for paths with Python 3.13 (#10103)

Co-authored-by: J. Nick Koston <[email protected]>
bdraco added a commit that referenced this pull request Dec 4, 2024
…pe` for paths with Python 3.13 (#10104)

Co-authored-by: J. Nick Koston <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-3.11 Trigger automatic backporting to the 3.11 release branch by Patchback robot backport-3.12 Trigger automatic backporting to the 3.12 release branch by Patchback robot bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant