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

PyImport_ReloadModule emits deprecation warning #84597

Closed
Robmaister mannequin opened this issue Apr 28, 2020 · 10 comments
Closed

PyImport_ReloadModule emits deprecation warning #84597

Robmaister mannequin opened this issue Apr 28, 2020 · 10 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@Robmaister
Copy link
Mannequin

Robmaister mannequin commented Apr 28, 2020

BPO 40417
Nosy @brettcannon, @ncoghlan, @ericsnowcurrently, @miss-islington, @Robmaister
PRs
  • bpo-40417: Fix deprecation warning in PyImport_ReloadModule #19750
  • [3.8] bpo-40417: Fix deprecation warning in PyImport_ReloadModule (GH-19750) #19934
  • [3.7] bpo-40417: Fix deprecation warning in PyImport_ReloadModule (GH-19750) #19935
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2020-05-06.01:04:18.065>
    created_at = <Date 2020-04-28.06:40:55.660>
    labels = ['interpreter-core', '3.8', 'type-bug', '3.7']
    title = 'PyImport_ReloadModule emits deprecation warning'
    updated_at = <Date 2020-05-06.01:07:16.269>
    user = 'https://github.com/Robmaister'

    bugs.python.org fields:

    activity = <Date 2020-05-06.01:07:16.269>
    actor = 'Robert Rouhani'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-05-06.01:04:18.065>
    closer = 'brett.cannon'
    components = ['Interpreter Core']
    creation = <Date 2020-04-28.06:40:55.660>
    creator = 'Robert Rouhani'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 40417
    keywords = ['patch']
    message_count = 10.0
    messages = ['367501', '367851', '367853', '367863', '367899', '368069', '368216', '368217', '368218', '368219']
    nosy_count = 6.0
    nosy_names = ['brett.cannon', 'ncoghlan', 'python-dev', 'eric.snow', 'miss-islington', 'Robert Rouhani']
    pr_nums = ['19750', '19934', '19935']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue40417'
    versions = ['Python 3.7', 'Python 3.8']

    @Robmaister
    Copy link
    Mannequin Author

    Robmaister mannequin commented Apr 28, 2020

    It appears as though PyImport_ReloadModule is importing the deprecated "imp" module.

    I integrated a newer version of Python into Unreal Engine 4, which internally calls this function for some of it's own modules. Normally a stray warning wouldn't be of much concern to me, but the process of "cooking" (converting raw assets to optimized/final assets) will fail if anything is written to stderr. This makes it impossible to package a copy of the game for testing or release without a workaround.

    I'm going to add a test to _testembed.c to verify my fix. Is this something that I should include in the Github PR?

    @Robmaister Robmaister mannequin added 3.9 only security fixes 3.7 (EOL) end of life 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels Apr 28, 2020
    @ericsnowcurrently
    Copy link
    Member

    Yeah, that looks like an oversight. I've approved your PR. Thanks!

    @ericsnowcurrently
    Copy link
    Member

    Did you have a need for this to be fixed in 3.8 or earlier? This seems reasonably and simple enough to backport. I suppose someone could be relying on an implicit import of the "imp" module, but that seems highly unlikely and suspect anyway. :)

    @Robmaister
    Copy link
    Mannequin Author

    Robmaister mannequin commented May 1, 2020

    We have a fairly straightforward workaround of using the "warnings" module
    to redirect to stdout, so we personally don't have a need.

    Unreal, however, follows the VFX Reference Platform (
    https://vfxplatform.com/) which is migrating from 2.7 to 3.7.x this year.
    They will likely run into this during their migration, so backporting to
    3.7 would be useful.

    On Fri, May 1, 2020 at 8:22 AM Eric Snow <report@bugs.python.org> wrote:

    Eric Snow <ericsnowcurrently@gmail.com> added the comment:

    Did you have a need for this to be fixed in 3.8 or earlier? This seems
    reasonably and simple enough to backport. I suppose someone could be
    relying on an implicit import of the "imp" module, but that seems highly
    unlikely and suspect anyway. :)

    ----------
    nosy: +brett.cannon, ncoghlan


    Python tracker <report@bugs.python.org>
    <https://bugs.python.org/issue40417\>


    @miss-islington
    Copy link
    Contributor

    New changeset f40bd46 by Robert Rouhani in branch 'master':
    bpo-40417: Fix deprecation warning in PyImport_ReloadModule (GH-19750)
    f40bd46

    @brettcannon
    Copy link
    Member

    This can't be backported cleanly. If you're up for making PRs for 3.8 and 3.7, Robert, we can look at applying them.

    @brettcannon brettcannon removed 3.9 only security fixes labels May 4, 2020
    @miss-islington
    Copy link
    Contributor

    New changeset a32587a by Robert Rouhani in branch '3.8':
    [3.8] bpo-40417: Fix deprecation warning in PyImport_ReloadModule (GH-19750) (GH-19934)
    a32587a

    @miss-islington
    Copy link
    Contributor

    New changeset d64fd61 by Robert Rouhani in branch '3.7':
    [3.7] bpo-40417: Fix deprecation warning in PyImport_ReloadModule (GH-19750) (GH-19935)
    d64fd61

    @brettcannon
    Copy link
    Member

    Thanks for all your hard work, Robert!

    @Robmaister
    Copy link
    Mannequin Author

    Robmaister mannequin commented May 6, 2020

    No problem! Happy to contribute where I can :)

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants