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

test_setup_requires failing on Python 3.4 #201

Closed
ghost opened this issue May 5, 2014 · 7 comments
Closed

test_setup_requires failing on Python 3.4 #201

ghost opened this issue May 5, 2014 · 7 comments

Comments

@ghost
Copy link

ghost commented May 5, 2014

Originally reported by: jaraco (Bitbucket: jaraco, GitHub: jaraco)


In d597181958a3, I disabled a test for Python 3.3 and earlier. Today, thanks to Travis' new Python 3.4 support, I added Python 3.4 to the Python versions tested, but now the test is failing on Python 3.4 also:

ERROR: test_setup_requires (setuptools.tests.test_easy_install.TestUserInstallTest)
Regression test for Distribute issue #318
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/build/jaraco/setuptools/setuptools/tests/test_easy_install.py", line 246, in test_setup_requires
  run_setup(test_setup_py, ['install'])
File "/home/travis/build/jaraco/setuptools/setuptools/sandbox.py", line 50, in run_setup
  lambda: execfile(
File "/home/travis/build/jaraco/setuptools/setuptools/sandbox.py", line 100, in run
  return func()
File "/home/travis/build/jaraco/setuptools/setuptools/sandbox.py", line 52, in <lambda>
  {'__file__':setup_script, '__name__':'__main__'}
File "/home/travis/build/jaraco/setuptools/setuptools/compat.py", line 78, in execfile
  exec(compile(source, fn, 'exec'), globs, locs)
File "setup.py", line 2, in <module>
  """Distutils setup file, used to install or test 'setuptools'"""
File "/opt/python/3.4.0/lib/python3.4/distutils/core.py", line 149, in setup
  dist.run_commands()
File "/opt/python/3.4.0/lib/python3.4/distutils/dist.py", line 955, in run_commands
  self.run_command(cmd)
File "/opt/python/3.4.0/lib/python3.4/distutils/dist.py", line 974, in run_command
  cmd_obj.run()
File "/home/travis/build/jaraco/setuptools/setuptools/command/install.py", line 61, in run
  if not self._called_from_setup(inspect.currentframe()):
File "/home/travis/build/jaraco/setuptools/setuptools/command/install.py", line 85, in _called_from_setup
  res = inspect.getouterframes(run_frame)[2]
File "/opt/python/3.4.0/lib/python3.4/inspect.py", line 1321, in getouterframes
  framelist.append((frame,) + getframeinfo(frame, context))
File "/opt/python/3.4.0/lib/python3.4/inspect.py", line 1296, in getframeinfo
  lines, lnum = findsource(frame)
File "/opt/python/3.4.0/lib/python3.4/inspect.py", line 709, in findsource
  if pat.match(lines[lnum]): break
IndexError: list index out of range

Curiously, this test doesn't fail on my Windows box against Python 3.4.0.


@ghost
Copy link
Author

ghost commented May 5, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


It appears to be a race condition that only appears if tests are run in a certain order. There is an upstream bug report, Python 1628987 marked as "won't fix". Based on that bug report, I believe the issue can be worked around by clearing the linecache in the setUp method for that class.

@ghost
Copy link
Author

ghost commented May 5, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


I attempted several tests clearing the linecache in different places, including test setUp, test execution, and near where the install command invokes inspect.currentframe, but to no avail.

@ghost
Copy link
Author

ghost commented May 5, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


There appears an additional, unlinked upstream bug report, Python 17735.

@ghost
Copy link
Author

ghost commented May 5, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Another open upstream report: Python 1218234

@ghost
Copy link
Author

ghost commented May 5, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Also reported in Python 993580, marked as a dup.

@ghost
Copy link
Author

ghost commented May 5, 2014

Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco):


Just suppress the spurious IndexError when it happens. Rely on the environments where the behavior doesn't fail until the upstream issue can be resolved. Fixes #201.

@ghost ghost added minor bug labels Mar 29, 2016
@ghost ghost closed this as completed Mar 29, 2016
@jaraco
Copy link
Member

jaraco commented Dec 5, 2020

The workaround is ad7c41a.

jaraco added a commit that referenced this issue Feb 6, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant