[
https://issues.apache.org/jira/browse/BEAM-9427?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17049768#comment-17049768
]
Valentyn Tymofieiev commented on BEAM-9427:
-------------------------------------------
I was able to reproduce this issue under Python 3.5.3 (using pyenv). I added an
artifical exception in contextlib.py, and caught the following stacktrace.
{noformat}
File
"/home/valentyn/projects/beam/beam/beam/build/gradleenv/-1227304285/lib/python3.5/site.py",
line 703, in <module>
main()
File
"/home/valentyn/projects/beam/beam/beam/build/gradleenv/-1227304285/lib/python3.5/site.py",
line 683, in main
paths_in_sys = addsitepackages(paths_in_sys)
File
"/home/valentyn/projects/beam/beam/beam/build/gradleenv/-1227304285/lib/python3.5/site.py",
line 282, in addsitepackages
addsitedir(sitedir, known_paths)
File
"/home/valentyn/projects/beam/beam/beam/build/gradleenv/-1227304285/lib/python3.5/site.py",
line 204, in addsitedir
addpackage(sitedir, name, known_paths)
File
"/home/valentyn/projects/beam/beam/beam/build/gradleenv/-1227304285/lib/python3.5/site.py",
line 173, in addpackage
exec(line)
File "<string>", line 1, in <module>
File
"/home/valentyn/projects/beam/beam/beam/build/gradleenv/-1227304285/lib/python3.5/importlib/util.py",
line 13, in <module>
from contextlib import contextmanager
File "/home/valentyn/.pyenv/versions/3.5.3/lib/python3.5/contextlib.py", line
8, in <module>
{noformat}
I was almost certain that this was a regression in virtualenv, that has had a
few releases recently: https://pypi.org/project/virtualenv/#history
However, suddenly I am no longer able to reproduce this issue... I am not sure
what has changed. The test are now working for me, both on 3.5.2 and 3.5.3.
> Python precommits flaky with ImportError: cannot import name 'ContextManager'
> -----------------------------------------------------------------------------
>
> Key: BEAM-9427
> URL: https://issues.apache.org/jira/browse/BEAM-9427
> Project: Beam
> Issue Type: Bug
> Components: sdk-py-core, test-failures
> Reporter: Udi Meiri
> Priority: Major
>
> https://builds.apache.org/job/beam_PreCommit_Python_Commit/11469/
> {code}
> 11:51:34 > Task :sdks:python:test-suites:tox:py35:testPy35Gcp FAILED
> 11:51:34 py35-gcp-pytest create:
> /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit/src/sdks/python/test-suites/tox/py35/build/srcs/sdks/python/target/.tox-py35-gcp-pytest/py35-gcp-pytest
> 11:51:34 ERROR: invocation failed (exit code 1), logfile:
> /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit/src/sdks/python/test-suites/tox/py35/build/srcs/sdks/python/target/.tox-py35-gcp-pytest/py35-gcp-pytest/log/py35-gcp-pytest-0.log
> 11:51:34 ================================== log start
> ===================================
> 11:51:34 ImportError: cannot import name 'ContextManager'
> 11:51:34
> 11:51:34 =================================== log end
> ====================================
> 11:51:34 ERROR: InvocationError for command
> /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit/src/build/gradleenv/-1227304285/bin/python3.5
> -m virtualenv --no-download --python
> /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit/src/build/gradleenv/-1227304285/bin/python3.5
> py35-gcp-pytest (exited with code 1)
> 11:51:34 ___________________________________ summary
> ____________________________________
> 11:51:34 ERROR: py35-gcp-pytest: InvocationError for command
> /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit/src/build/gradleenv/-1227304285/bin/python3.5
> -m virtualenv --no-download --python
> /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit/src/build/gradleenv/-1227304285/bin/python3.5
> py35-gcp-pytest (exited with code 1)
> {code}
> {code}
> 11:51:35 > Task :sdks:python:test-suites:tox:py35:testPy35Cython FAILED
> 11:51:35 py35-cython-pytest create:
> /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit/src/sdks/python/test-suites/tox/py35/build/srcs/sdks/python/target/.tox-py35-cython-pytest/py35-cython-pytest
> 11:51:35 ERROR: invocation failed (exit code 1), logfile:
> /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit/src/sdks/python/test-suites/tox/py35/build/srcs/sdks/python/target/.tox-py35-cython-pytest/py35-cython-pytest/log/py35-cython-pytest-0.log
> 11:51:35 ================================== log start
> ===================================
> 11:51:35 ImportError: cannot import name 'ContextManager'
> 11:51:35
> 11:51:35 =================================== log end
> ====================================
> 11:51:35 ERROR: InvocationError for command
> /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit/src/build/gradleenv/-1227304285/bin/python3.5
> -m virtualenv --no-download --python
> /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit/src/build/gradleenv/-1227304285/bin/python3.5
> py35-cython-pytest (exited with code 1)
> 11:51:35 ___________________________________ summary
> ____________________________________
> 11:51:35 ERROR: py35-cython-pytest: InvocationError for command
> /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit/src/build/gradleenv/-1227304285/bin/python3.5
> -m virtualenv --no-download --python
> /home/jenkins/jenkins-slave/workspace/beam_PreCommit_Python_Commit/src/build/gradleenv/-1227304285/bin/python3.5
> py35-cython-pytest (exited with code 1)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)