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

SyntaxError on Python 2 with 3.79.2 #1648

Closed
reaperhulk opened this issue Oct 23, 2018 · 2 comments
Closed

SyntaxError on Python 2 with 3.79.2 #1648

reaperhulk opened this issue Oct 23, 2018 · 2 comments
Labels
bug something is clearly wrong here

Comments

@reaperhulk
Copy link
Contributor

reaperhulk commented Oct 23, 2018

The latest release causes a SyntaxError on older Python 2.7 (occurs on 2.7.3 and 2.7.5 in pyca/cryptography's CI):

Traceback (most recent call last):
  File "/home/jenkins/workspace/4485-S2JEK2AOWI4X57D@2/cryptography/.tox/py27/local/lib/python2.7/site-packages/pytest.py", line 77, in <module>
    raise SystemExit(pytest.main())
  File "/home/jenkins/workspace/4485-S2JEK2AOWI4X57D@2/cryptography/.tox/py27/local/lib/python2.7/site-packages/_pytest/config/__init__.py", line 49, in main
    config = _prepareconfig(args, plugins)
  File "/home/jenkins/workspace/4485-S2JEK2AOWI4X57D@2/cryptography/.tox/py27/local/lib/python2.7/site-packages/_pytest/config/__init__.py", line 186, in _prepareconfig
    pluginmanager=pluginmanager, args=args
  File "/home/jenkins/workspace/4485-S2JEK2AOWI4X57D@2/cryptography/.tox/py27/local/lib/python2.7/site-packages/pluggy/hooks.py", line 284, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/home/jenkins/workspace/4485-S2JEK2AOWI4X57D@2/cryptography/.tox/py27/local/lib/python2.7/site-packages/pluggy/manager.py", line 67, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/home/jenkins/workspace/4485-S2JEK2AOWI4X57D@2/cryptography/.tox/py27/local/lib/python2.7/site-packages/pluggy/manager.py", line 61, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/home/jenkins/workspace/4485-S2JEK2AOWI4X57D@2/cryptography/.tox/py27/local/lib/python2.7/site-packages/pluggy/callers.py", line 203, in _multicall
    gen.send(outcome)
  File "/home/jenkins/workspace/4485-S2JEK2AOWI4X57D@2/cryptography/.tox/py27/local/lib/python2.7/site-packages/_pytest/helpconfig.py", line 89, in pytest_cmdline_parse
    config = outcome.get_result()
  File "/home/jenkins/workspace/4485-S2JEK2AOWI4X57D@2/cryptography/.tox/py27/local/lib/python2.7/site-packages/pluggy/callers.py", line 81, in get_result
    _reraise(*ex)  # noqa
  File "/home/jenkins/workspace/4485-S2JEK2AOWI4X57D@2/cryptography/.tox/py27/local/lib/python2.7/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/home/jenkins/workspace/4485-S2JEK2AOWI4X57D@2/cryptography/.tox/py27/local/lib/python2.7/site-packages/_pytest/config/__init__.py", line 656, in pytest_cmdline_parse
    self.parse(args)
  File "/home/jenkins/workspace/4485-S2JEK2AOWI4X57D@2/cryptography/.tox/py27/local/lib/python2.7/site-packages/_pytest/config/__init__.py", line 828, in parse
    self._preparse(args, addopts=addopts)
  File "/home/jenkins/workspace/4485-S2JEK2AOWI4X57D@2/cryptography/.tox/py27/local/lib/python2.7/site-packages/_pytest/config/__init__.py", line 780, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/home/jenkins/workspace/4485-S2JEK2AOWI4X57D@2/cryptography/.tox/py27/local/lib/python2.7/site-packages/pluggy/manager.py", line 267, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/home/jenkins/workspace/4485-S2JEK2AOWI4X57D@2/cryptography/.tox/py27/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2332, in load
    return self.resolve()
  File "/home/jenkins/workspace/4485-S2JEK2AOWI4X57D@2/cryptography/.tox/py27/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2338, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/jenkins/workspace/4485-S2JEK2AOWI4X57D@2/cryptography/.tox/py27/local/lib/python2.7/site-packages/hypothesis/__init__.py", line 30, in <module>
    from hypothesis.core import given, find, example, seed, reproduce_failure, \
  File "/home/jenkins/workspace/4485-S2JEK2AOWI4X57D@2/cryptography/.tox/py27/local/lib/python2.7/site-packages/hypothesis/core.py", line 948
    exec(
SyntaxError: unqualified exec is not allowed in function 'wrapped_test' it is a nested function
@Zac-HD Zac-HD added the bug something is clearly wrong here label Oct 23, 2018
@Zac-HD
Copy link
Member

Zac-HD commented Oct 23, 2018

Oh... dear. I don't want to drop traceback elision entirely for Python 2, but the best solution so far is eval(exec(...)) behind a version guard 😱... I'll keep looking.

@Zac-HD
Copy link
Member

Zac-HD commented Oct 23, 2018

The root cause is BPO-21591, so I don't think there's going to be a better solution 😭

wohali added a commit to apache/couchdb-ci that referenced this issue Oct 23, 2018
Pin hypothesis to known good version
Workaround for HypothesisWorks/hypothesis#1648
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something is clearly wrong here
Projects
None yet
Development

No branches or pull requests

2 participants