GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-121604: Make sure all deprecated items in importlib raise DeprecationWarning by tomasr8 · Pull Request #128007 · python/cpython

Conversation

@tomasr8

@tomasr8 tomasr8 commented Dec 16, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Largely based on work done by @rashansmith, this adds deprecation warnings for the following importlib classes, methods and attributes (using the docs as the source of truth):

  • 
 importlib.abc.ResourceLoader
  • 
 importlib.machinery.WindowsRegistryFinder
  • 
 importlib.abc.SourceLoader.path_mtime()
  • 
 importlib.machinery.DEBUG_BYTECODE_SUFFIXES
  • 
 importlib.machinery.OPTIMIZED_BYTECODE_SUFFIXES

The deprecation messages are based on the docs. Warnings for DEBUG_BYTECODE_SUFFIXES and OPTIMIZED_BYTECODE_SUFFIXES are implemented using a module __getattr__.

Feedback welcome!

  • Issue: Make sure all deprecated items in importlib raise DeprecationWarning #121604

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
tomasr8 and others added 7 commits December 16, 2024 21:40
@tomasr8 @rashansmith
Add DeprecationWarning for path_mtime
d4844c5
Co-authored-by: rashansmith <[email protected]>
@tomasr8 @rashansmith
Add DeprecationWarning for ResourceLoader
cbe54a3
Co-authored-by: rashansmith <[email protected]>
@tomasr8 @rashansmith
Add DeprecationWarning for DEBUG_BYTECODE_SUFFIXES and OPTIMIZED_BYTE…
b73ad85
…CODE_SUFFIXES.

Co-authored-by: rashansmith <[email protected]>
@tomasr8 @rashansmith
Add DeprecationWarning for WindowsRegistryFinder
5375cf6
Co-authored-by: rashansmith <[email protected]>
@tomasr8
Update tests
3306e7e
@tomasr8
Add news entry
5c7c5e9
@tomasr8
Unify quotes
7079bdd
@tomasr8
tomasr8 requested review from brettcannon, ericsnowcurrently, ncoghlan and warsaw as code owners December 16, 2024 21:29
@bedevere-app bedevere-app Bot mentioned this pull request Dec 16, 2024
Make sure all deprecated items in importlib raise DeprecationWarning #121604
Closed
11 tasks done
@bedevere-app bedevere-app Bot added the awaiting review label Dec 16, 2024
@tomasr8

tomasr8 commented Dec 16, 2024

Copy link
Copy Markdown
Member Author

cc @StanFromIreland

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

StanFromIreland
StanFromIreland reviewed Dec 16, 2024
View reviewed changes

@StanFromIreland StanFromIreland left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two little things I noticed. I did not have time to go through the rest but it looks good in general.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tomasr8 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
Comment thread Lib/importlib/_bootstrap_external.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/importlib/abc.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

tomasr8 and others added 2 commits December 16, 2024 22:55
@tomasr8 @StanFromIreland
Update Lib/importlib/abc.py
651e40e
Co-authored-by: Stan Ulbrych <[email protected]>
@tomasr8
Fix tests
df86fcf
This was referenced Dec 18, 2024
gh-121604: Raise DeprecationWarnings in importlib #121765
Closed
Meta issue for cleaning up import system cruft #97850
Open
brettcannon
brettcannon requested changes Jan 6, 2025
View reviewed changes
Comment thread Lib/importlib/_bootstrap_external.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/importlib/machinery.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/importlib/machinery.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting changes and removed awaiting review labels Jan 6, 2025
@bedevere-app

bedevere-app Bot commented Jan 6, 2025

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@brettcannon

brettcannon commented Jan 6, 2025

Copy link
Copy Markdown
Member

Sorry about the review delay!

tomasr8 reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tomasr8 and others added 4 commits January 7, 2025 23:38
@tomasr8 @brettcannon
Improve deprecation message
a22637b
Co-authored-by: Brett Cannon <[email protected]>
@tomasr8
Raise DeprecationWarning in find_spec instead of __init__
60d20c0
@tomasr8
Remove extra import
f3faa95
@tomasr8
Align code
5fa376c
@tomasr8

tomasr8 commented Jan 7, 2025

Copy link
Copy Markdown
Member Author

Sorry about the review delay!

No worries, and thanks for the review! I think I addressed your comments if you feel like having another look :)

I have made the requested changes; please review again

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting changes label Jan 7, 2025
@bedevere-app bedevere-app Bot added the awaiting change review label Jan 7, 2025
@bedevere-app

bedevere-app Bot commented Jan 7, 2025

Copy link
Copy Markdown

Thanks for making the requested changes!

@brettcannon: please review the changes made to this pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app
bedevere-app Bot requested a review from brettcannon January 7, 2025 23:37
brettcannon
brettcannon approved these changes Jan 14, 2025
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting change review labels Jan 14, 2025
@brettcannon
Merge branch 'main' into importlib-deprecations
2b3e9d2
brettcannon
brettcannon reviewed Jan 14, 2025
View reviewed changes
Comment thread Misc/NEWS.d/next/Library/2024-12-16-22-20-38.gh-issue-121604.m3Xn4G.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@brettcannon
Update news entry to be more specific about what's deprecated
adccc7d
@brettcannon
brettcannon merged commit bd3baa8 into python:main Jan 15, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label Jan 15, 2025
@brettcannon

brettcannon commented Jan 15, 2025

Copy link
Copy Markdown
Member

Thanks, @tomasr8 for bearing with me and my delayed reviews! 😅

tomasr8 reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tomasr8
tomasr8 deleted the importlib-deprecations branch January 15, 2025 06:59
@tomasr8

tomasr8 commented Jan 15, 2025

Copy link
Copy Markdown
Member Author

No worries :) Thanks for the review!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

graingert
graingert reviewed Jan 15, 2025
View reviewed changes
Comment thread Lib/importlib/abc.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@brettcannon brettcannon brettcannon approved these changes
@graingert graingert graingert left review comments
@StanFromIreland StanFromIreland StanFromIreland left review comments
@ericsnowcurrently ericsnowcurrently Awaiting requested review from ericsnowcurrently ericsnowcurrently is a code owner
@ncoghlan ncoghlan Awaiting requested review from ncoghlan ncoghlan is a code owner
@warsaw warsaw Awaiting requested review from warsaw warsaw is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@tomasr8 @brettcannon @graingert @StanFromIreland
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.