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 — Update imp to importlib for py3 by jccurtis · Pull Request #574 · PythonCharmers/python-future

Conversation

@jccurtis

@jccurtis jccurtis commented Sep 16, 2020

Copy link
Copy Markdown

imp was deprecated in py36. While this package is not needed in most py3 packages after Jan2020, there still are some which maintain py27 support and this DeprecationWarning pops up. I think I covered all cases in the src tree. There are 2 (AFAIK) locations elsewhere (examples and docs) that use from imp import reload. I did not patch these.

Closes #488

Sorry, something went wrong.

Uh oh!

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

anders-kiaer, rouge8, aaronkollasch, and kevinlinxc reacted with thumbs up emoji
All reactions
  • 👍 4 reactions
Joseph Curtis added 2 commits September 16, 2020 11:22
Joseph Curtis
Update imp to importlib for py3
05bc771
Joseph Curtis
fix import reload for python<3.6
dbd3cd0
@jccurtis

jccurtis commented Sep 16, 2020

Copy link
Copy Markdown
Author

python36/37 are failing for some tests which may have to do with the reload behavior between imp and importlib but I haven't dug into this yet. Any thoughts?

All reactions

Sorry, something went wrong.

Uh oh!

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

jccurtis
jccurtis commented Sep 16, 2020
View reviewed changes
Comment thread tests/test_future/test_standard_library.py Outdated
import importlib as imp
else:
import imp
imp.reload(imp)

@jccurtis jccurtis Sep 16, 2020

Copy link
Copy Markdown
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.

I wonder if this is causing the CI failure.

Sorry, something went wrong.

Uh oh!

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

All reactions
@alanyee

alanyee commented Sep 30, 2020

Copy link
Copy Markdown

According to docs, the module has been deprecated since 3.4 with certain methods deprecated since 3.3. Looking at specific methods such as https://docs.python.org/3/library/imp.html#imp.find_module, you might not be able to do a blanket alias and have to do specific imports.

All reactions

Sorry, something went wrong.

Uh oh!

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

@elderlabs elderlabs mentioned this pull request Mar 31, 2023
Importing imp in standard_library raises a PendingDeprecationWarning #246
Open
@SanderWegter SanderWegter mentioned this pull request May 2, 2023
[BUG] DeprecationWarning future library easysnmp/easysnmp#189
Open
@cdce8p cdce8p mentioned this pull request Jul 20, 2023
TEST: Add 3.12-dev [ci] cdce8p/ha-core#53
Closed
25 of 32 tasks
@matrss matrss mentioned this pull request Aug 25, 2023
DeprecationWarnings from dependencies Open-MSS/MSS#1942
Closed
5 tasks done
@cdce8p cdce8p mentioned this pull request Oct 10, 2023
Add support for Python 3.12 home-assistant/core#101651
Merged
6 of 28 tasks
@edschofield
Merge branch 'master' into fix-importlib-deprecation
925039a
@edschofield
edschofield merged commit 6babd20 into PythonCharmers:master Feb 21, 2024
@edschofield

edschofield commented Feb 21, 2024

Copy link
Copy Markdown
Contributor

Thanks @jccurtis !

All reactions

Sorry, something went wrong.

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

No reviews

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.

deprecation warning importing imp

Uh oh!

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

3 participants

@jccurtis @alanyee @edschofield
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.