Skip to content

python Lib/test/regrtest.py -R 3:3: test_zipimport_support fails #55180

Closed

Description

@vstinner
BPO 10971
Nosy @brettcannon, @ncoghlan, @vstinner
Files
  • issue10971_temp_module_cleanup.diff: Remove temp modules from module cache
  • 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 2011-02-07.14:54:38.397>
    created_at = <Date 2011-01-21.11:14:42.446>
    labels = ['tests']
    title = 'python Lib/test/regrtest.py -R 3:3: test_zipimport_support fails'
    updated_at = <Date 2011-02-07.14:57:02.184>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2011-02-07.14:57:02.184>
    actor = 'ncoghlan'
    assignee = 'none'
    closed = True
    closed_date = <Date 2011-02-07.14:54:38.397>
    closer = 'ncoghlan'
    components = ['Tests']
    creation = <Date 2011-01-21.11:14:42.446>
    creator = 'vstinner'
    dependencies = []
    files = ['20702']
    hgrepos = []
    issue_num = 10971
    keywords = []
    message_count = 5.0
    messages = ['126718', '128063', '128064', '128120', '128121']
    nosy_count = 3.0
    nosy_names = ['brett.cannon', 'ncoghlan', 'vstinner']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue10971'
    versions = ['Python 3.2']

    Activity

    1. vstinner commented on Jan 21, 2011

      @vstinner
      MemberAuthor

      "./python Lib/test/regrtest.py test_zipimport_support" pass, but not with the -R option.

      ----

      $ ./python Lib/test/regrtest.py -R 3:3: test_zipimport_support
      [1/1] test_zipimport_support
      beginning 6 repetitions
      123456
      test test_zipimport_support failed -- Traceback (most recent call last):
        File "/home/haypo/prog/SVN/py3k/Lib/test/test_zipimport_support.py", line 96, in test_inspect_getsource_issue4223
          self.assertEqual(inspect.getsource(zip_pkg.foo), test_src)
        File "/home/haypo/prog/SVN/py3k/Lib/inspect.py", line 693, in getsource
          lines, lnum = getsourcelines(object)
        File "/home/haypo/prog/SVN/py3k/Lib/inspect.py", line 682, in getsourcelines
          lines, lnum = findsource(object)
        File "/home/haypo/prog/SVN/py3k/Lib/inspect.py", line 530, in findsource
          raise IOError('could not get source code')
      IOError: could not get source code

      1 test failed:
      test_zipimport_support
      ----

    2. ncoghlan commented on Feb 6, 2011

      @ncoghlan
      Contributor

      My fix for the issues with reloading of the _ssl module meant that a couple of temporary modules weren't getting cleared out of sys.modules properly, thus confusing the second and later runs of affected tests.

      Attached patch adds explicit removal calls for the affected modules.

    3. ncoghlan commented on Feb 6, 2011

      @ncoghlan
      Contributor

      Helps to add the patch rather than the whole file...

    4. ncoghlan commented on Feb 7, 2011

      @ncoghlan
      Contributor

      Fixed for 3.2 in r88368 (no backport needed, since the older test suites didn't exhibit the original problem with the _ssl module reloading)

    5. ncoghlan commented on Feb 7, 2011

      @ncoghlan
      Contributor

      (Georg reviewed the patch after I mentioned it to him on IRC)

    6. transferred this issue fromon Apr 10, 2022
    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

      testsTests in the Lib/test dir

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions