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 — Modify test_codecs to use the new codecs.unregister() function · Issue #86085 · python/cpython

Modify test_codecs to use the new codecs.unregister() function #86085

New issue
Copy link
New issue
Copy link
Closed
Closed
Modify test_codecs to use the new codecs.unregister() function#86085
Copy link
Labels
3.10 (EOL)end of lifeend of lifetestsTests in the Lib/test dirTests in the Lib/test dirtype-featureA feature request or enhancementA feature request or enhancement

Description

@shihai1991
shihai1991
opened on Oct 3, 2020
Issue body actions
BPO 41919
Nosy @vstinner, @pablogsal, @shihai1991
PRs
  • bpo-41919: Move the codecs.register operation to the setup of testcases. #22513
  • bpo-41919: Revert "bpo-41919: Move the codecs.register operation to the setup of testcases." #22961
  • bpo-41919: Avoid resource leak in test_io module #22973
  • 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-10-25.18:38:56.606>
    created_at = <Date 2020-10-03.09:37:07.680>
    labels = ['type-feature', 'tests', '3.10']
    title = 'Modify test_codecs to use the new codecs.unregister() function'
    updated_at = <Date 2020-10-25.18:38:56.605>
    user = 'https://github.com/shihai1991'

    bugs.python.org fields:

    activity = <Date 2020-10-25.18:38:56.605>
    actor = 'pablogsal'
    assignee = 'none'
    closed = True
    closed_date = <Date 2020-10-25.18:38:56.606>
    closer = 'pablogsal'
    components = ['Tests']
    creation = <Date 2020-10-03.09:37:07.680>
    creator = 'shihai1991'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 41919
    keywords = ['patch']
    message_count = 6.0
    messages = ['377863', '378708', '379565', '379567', '379584', '379598']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'pablogsal', 'shihai1991']
    pr_nums = ['22513', '22961', '22973']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue41919'
    versions = ['Python 3.10']

    Linked PRs

    • gh-86085: Remove _PyCodec_Forget() declaration #106377

    Activity

    1. shihai1991 commented on Oct 3, 2020

      @shihai1991
      shihai1991
      on Oct 3, 2020
      MemberAuthor
      More actions

      After PR22360 merged, we can move the codecs' register operation to testcases.

    2. shihai1991
      added
      3.10 (EOL)end of lifeend of life
      testsTests in the Lib/test dirTests in the Lib/test dir
      type-featureA feature request or enhancementA feature request or enhancement
      on Oct 3, 2020
    3. shihai1991
      changed the title [-]Move the codecs' register operation to testcases[/-] [+]Move the codecs.register operation to testcases[/+] on Oct 3, 2020
    4. shihai1991
      changed the title [-]Move the codecs' register operation to testcases[/-] [+]Move the codecs.register operation to testcases[/+] on Oct 3, 2020
    5. vstinner
      changed the title [-]Move the codecs.register operation to testcases[/-] [+]Modify test_codecs to use the new codecs.unregister() function[/+] on Oct 3, 2020
    6. vstinner
      changed the title [-]Move the codecs.register operation to testcases[/-] [+]Modify test_codecs to use the new codecs.unregister() function[/+] on Oct 3, 2020
    7. vstinner commented on Oct 16, 2020

      @vstinner
      vstinner
      on Oct 16, 2020
      Member
      More actions

      New changeset c9f696c by Hai Shi in branch 'master':
      bpo-41919, test_codecs: Move codecs.register calls to setUp() (GH-22513)
      c9f696c

    8. vstinner
      closed this as completedon Oct 16, 2020
    9. vstinner
      closed this as completedon Oct 16, 2020
    10. pablogsal commented on Oct 25, 2020

      @pablogsal
      pablogsal
      on Oct 25, 2020
      Member
      More actions

      Commit c9f696c introduced a reference leak in the test suite. See https://bugs.python.org/issue42145:

      c9f696c is the first bad commit
      commit c9f696c
      Author: Hai Shi <[email protected]>
      Date: Fri Oct 16 16:34:15 2020 +0800

      bpo-41919, test_codecs: Move codecs.register calls to setUp() (GH-22513)
      

      Reverting the commit eliminates the problem:

      rences, sum=12
      test_io leaked [1, 1, 1, 1] memory blocks, sum=4
      test_io failed

      == Tests result: FAILURE ==

      1 test failed:
      test_io

      Total duration: 397 ms
      Tests result: FAILURE
      g
      ~/github/python/master master|bisect*
      ❯ git revert c9f696c
      Auto-merging Lib/test/test_codecs.py
      [master f3de7c00b4] Revert "bpo-41919, test_codecs: Move codecs.register calls to setUp() (GH-22513)"
      7 files changed, 112 insertions(+), 16 deletions(-)

      ~/github/python/master master|bisect* ⇡
      ❯ make -j -s
      CC='gcc -pthread' LDSHARED='gcc -pthread -shared ' OPT='-g -Og -Wall' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E ./setup.py -q build

      The following modules found by detect_modules() in setup.py, have been
      built by the Makefile instead, as configured by the Setup files:
      _abc atexit pwd
      time

      ~/github/python/master master|bisect* ⇡
      ❯ ./python -m test test_io -m test.test_io.CTextIOWrapperTest.test_read_one_by_one -R :
      0:00:00 load avg: 2.57 Run tests sequentially
      0:00:00 load avg: 2.57 [1/1] test_io
      beginning 9 repetitions
      123456789
      .........

      == Tests result: SUCCESS ==

      1 test OK.

      Total duration: 455 ms
      Tests result: SUCCESS

      * Move the codecs' (un)register operation to testcases.
      * Remove _codecs._forget_codec() and _PyCodec_Forget()
      

      Lib/test/test_charmapcodec.py | 7 +++++--
      Lib/test/test_codecs.py | 25 +++----------------------
      Lib/test/test_io.py | 7 +++----
      Lib/test/test_unicode.py | 5 ++++-
      Modules/_codecsmodule.c | 20 --------------------
      Modules/clinic/_codecsmodule.c.h | 39 +--------------------------------------
      Python/codecs.c | 25 -------------------------
      7 files changed, 16 insertions(+), 112 deletions(-)

    11. pablogsal commented on Oct 25, 2020

      @pablogsal
      pablogsal
      on Oct 25, 2020
      Member
      More actions

      AS this is masking other issues in the build bots, we need to revert the commit unless is fixed in 24 hours per the buildbot workflow

    12. pablogsal
      reopened this on Oct 25, 2020
    13. pablogsal
      reopened this on Oct 25, 2020
    14. shihai1991 commented on Oct 25, 2020

      @shihai1991
      shihai1991
      on Oct 25, 2020
      MemberAuthor
      More actions

      AS this is masking other issues in the build bots, we need to revert the commit unless is fixed in 24 hours per the buildbot workflow

      Thanks, Pablo. I checked that only test_io.py have resource leak.
      I create PR-22973, pls take a look if you have free time, thanks.

    15. pablogsal commented on Oct 25, 2020

      @pablogsal
      pablogsal
      on Oct 25, 2020
      Member
      More actions

      New changeset 14cdc21 by Hai Shi in branch 'master':
      bpo-41919: Avoid resource leak in test_io (GH-22973)
      14cdc21

    16. pablogsal
      closed this as completedon Oct 25, 2020
    17. pablogsal
      closed this as completedon Oct 25, 2020
    18. ezio-melotti
      transferred this issue fromon Apr 10, 2022
    19. vstinner
      added 2 commits that reference this issue on Jul 3, 2023

      pythongh-86085: Remove _PyCodec_Forget() declaration

      773d550

      gh-86085: Remove _PyCodec_Forget() declaration (#106377)

      f6d2bb1
    20. carljm
      added a commit that references this issue on Jul 4, 2023

      Merge branch 'main' into cachedpropdoublecheck

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

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.10 (EOL)end of lifeend of lifetestsTests in the Lib/test dirTests in the Lib/test dirtype-featureA feature request or enhancementA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions

        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.