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 — bpo-29576: Improve some deprecations in the importlib by Carreau · Pull Request #32 · python/cpython

Conversation

@Carreau

@Carreau Carreau commented Feb 12, 2017

Copy link
Copy Markdown
Contributor

Add the python version since the functionality is deprecated,
and raise a couple of deprecation warnings in a few places.

Theses functions are marked as deprecated in the documentation, but
especially in existing codebase, programmers tends to not re-check
whether functions are deprecated. So trigger the warning when possible.

It's also more probable that a developer will drop deprecated
functionality if we immediately give them information about
replacement API, and not have them to go find it in the documentation.

Include deprecation information in DocString as well, as many tools pull
documentation from there and not from docs.python.org.

Sorry, something went wrong.

Uh oh!

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

All reactions
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Feb 12, 2017
@berkerpeksag
berkerpeksag requested a review from brettcannon February 12, 2017 00:42
fgregg
fgregg reviewed Feb 12, 2017
View reviewed changes
Comment thread Lib/importlib/abc.py Outdated

@fgregg fgregg Feb 12, 2017

Copy link
Copy Markdown
Contributor

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.

typo here s/MetaPatFinder/MetaPathFinder/

Sorry, something went wrong.

Uh oh!

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

All reactions

@Carreau Carreau Feb 12, 2017

Copy link
Copy Markdown
Contributor Author

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.

Oops indeed, thanks.

Sorry, something went wrong.

Uh oh!

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

All reactions
@Carreau
Carreau force-pushed the deprecations branch from 8cc3e57 to 58d8d3c Compare February 12, 2017 19:46
@codecov

codecov Bot commented Feb 12, 2017

Copy link
Copy Markdown

Codecov Report

Merging #32 into master will decrease coverage by -0.01%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master      #32      +/-   ##
==========================================
- Coverage   82.37%   82.36%   -0.01%     
==========================================
  Files        1427     1427              
  Lines      350948   350951       +3     
==========================================
- Hits       289093   289062      -31     
- Misses      61855    61889      +34

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c22bfaa...58d8d3c. Read the comment docs.

All reactions

Sorry, something went wrong.

Uh oh!

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

brettcannon
brettcannon requested changes Feb 15, 2017
View reviewed changes

@brettcannon brettcannon 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.

Could you add tests to make sure the warnings are being raised?

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Lib/importlib/abc.py Outdated

@brettcannon brettcannon Feb 15, 2017

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.

This line is somewhat redundant since the deprecation is mentioned in the previous paragraph. Maybe just add the version it was deprecated in above?

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Lib/importlib/abc.py Outdated

@brettcannon brettcannon Feb 15, 2017

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.

The deprecation is mentioned in the above paragraph, so if you would like to add the version info just toss in up there.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Lib/importlib/abc.py Outdated

@brettcannon brettcannon Feb 15, 2017

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.

Please add () after find_spec.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Lib/importlib/abc.py Outdated

@brettcannon brettcannon Feb 15, 2017

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.

Please add() as appropriate.

Sorry, something went wrong.

Uh oh!

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

All reactions
@Carreau
Improve some deprecations in the importlib
51e8898
Add the python version since the functionality is deprecated,
and raise a couple of deprecation warnings in a few places.

Theses functions are marked as deprecated in the documentation, but
especially in existing codebase, programmers tends to not re-check
whether functions are deprecated. So trigger the warning when possible.

It's also more probable that a developer will drop deprecated
functionality if we immediately give them information about
replacement API, and not have them to go find it in the documentation.

Include deprecation information in DocString as well as many tools pull
documentation from there and not from docs.python.org.

Add test making sure `find_loader()` and `find_module()` Both emit a
deprecation warning.
@Carreau
Carreau force-pushed the deprecations branch from 58d8d3c to 51e8898 Compare February 15, 2017 20:11
@Carreau

Carreau commented Feb 15, 2017

Copy link
Copy Markdown
Contributor Author

All comments should be addressed.

All reactions

Sorry, something went wrong.

Uh oh!

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

brettcannon
brettcannon approved these changes Feb 15, 2017
View reviewed changes
@brettcannon

brettcannon commented Feb 15, 2017

Copy link
Copy Markdown
Member

Thanks! Please add entries in Misc/NEWS and one in What's New in the "deprecated" section and this will be ready to be merged!

All reactions

Sorry, something went wrong.

Uh oh!

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

@Carreau Carreau changed the title Improve some deprecations in the importlib bpo-29576: Improve some deprecations in the importlib Feb 16, 2017
@Carreau
Ad entry to Misc/NEWS and what's new 3.7
db83323
@brettcannon
brettcannon merged commit 1d4601c into python:master Feb 16, 2017
@brettcannon

brettcannon commented Feb 16, 2017

Copy link
Copy Markdown
Member

Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

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

@Carreau
Carreau deleted the deprecations branch February 16, 2017 02:05
@Carreau

Carreau commented Feb 16, 2017

Copy link
Copy Markdown
Contributor Author

Thanks !

All reactions

Sorry, something went wrong.

Uh oh!

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

@mdboom mdboom mentioned this pull request Aug 25, 2022
Assert and incorrect error message when loading source file containing invalid UTF-8 #96268
Closed
@ziegenbalg ziegenbalg mentioned this pull request Nov 30, 2022
double free in io.TextIOWrapper #72573
Closed
jaraco pushed a commit that referenced this pull request Dec 2, 2022
@Mariatta
Set the task rate limit to 1 task per minute (GH-32)
375d8d1
jaraco pushed a commit to jaraco/cpython that referenced this pull request Feb 17, 2023
@warsaw
Support text open(), though not by default (python#32)
8475c05
Closes python#31
Fidget-Spinner referenced this pull request in pylbbv/pylbbv May 27, 2023
@JuliaPoo
Fix: Bug in typeprop handling UNPACK_*, and bug in COPY_NO_INCREF (#32)
15aa9c1
@gvanrossum gvanrossum mentioned this pull request Aug 22, 2023
heap-use-after-free in _PyFunction_LookupByVersion #108253
Closed
@LinanV LinanV mentioned this pull request Oct 23, 2023
Objects/typeobject.c: No such file or directory. #111203
Closed
@stasos24 stasos24 mentioned this pull request Oct 24, 2023
Modules/cjkcodecs/_codecs_iso2022.c - read out of bounds #101180
Closed
@williamhu020 williamhu020 mentioned this pull request Nov 5, 2023
Use the API C of 'Py-NewInterpreterFromConfig' to exit unexpectedly in multiple threads. #111751
Closed
@kcatss kcatss mentioned this pull request Nov 15, 2023
Use-after-free in unregister() of atexit module #112127
Closed
@kcatss kcatss mentioned this pull request Jan 14, 2024
crash in long_vectorcall in longobject.c #114050
Closed
@kcatss kcatss mentioned this pull request Feb 20, 2024
Use After Free at _heapreplace_max #115706
Closed
@ngoldbaum ngoldbaum mentioned this pull request Sep 23, 2024
Crash running PyO3 tests with --test-threads=1000 #124375
Closed
This was referenced Feb 11, 2025
segmentfault when pip installing setuptools #129992
Closed
segmentfault when pip installing setuptools #129993
Closed
@DominiquePACCO DominiquePACCO mentioned this pull request Jun 3, 2025
PdfWriter add_page adds (re)writes old page instead of new #135062
Closed
@sergey-miryanov sergey-miryanov mentioned this pull request Dec 18, 2025
Observed memory leak in ssl library: Python 3.14 GC issue #142516
Closed
@Qanux Qanux mentioned this pull request Feb 11, 2026
heap-buffer-overflow in functools.partial.__repr__() #144475
Closed
@ngoldbaum ngoldbaum mentioned this pull request Mar 6, 2026
Remove deprecated and undocumented function ctypes.SetPointerType #133866
Closed
@johng johng mentioned this pull request Jul 19, 2026
use-after-free: functools partial #154189
Closed
@djarfluka djarfluka mentioned this pull request Sep 12, 2026
Heap UAF in io.TextIOWrapper read path via reentrant detach() #157363
Open
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
+1 more reviewer
@fgregg fgregg fgregg left review comments
Reviewers whose approvals may not affect merge requirements

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

@Carreau @brettcannon @fgregg @the-knights-who-say-ni
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.