New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 701914 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug



Sign in to add a comment

virtualenv causes AttributeError: 'module' object has no attribute 'openssl_md_meth_names'

Project Member Reported by ayatane@chromium.org, Mar 15 2017

Issue description

Virtualenv causes AttributeError: 'module' object has no attribute 'openssl_md_meth_names'.

This is because _hashlib.so starting from Python 2.7.9 has this attribute, but doesn't before that.  The CrOS builder jail (cros_sdk) has Python 2.7.10 but the builders themselves have Python 2.7.3 (and my Goobuntu workstation has Python 2.7.6 for reference).

I don't have a reproduction yet, but I highly suspect the version mismatch to be the problem, with respect to the virtualenv.

Examples:

- https://chromium-review.googlesource.com/c/450872/2/cbuildbot/topology_unittest.py
- (need to find previous case of this happening)

Example traceback:

Traceback (most recent call last):
  File "lib/logdog_unittest", line 14, in <module>
    import wrapper
  File "/mnt/host/source/chromite/scripts/wrapper.py", line 76, in <module>
    from chromite.lib import commandline
  File "/mnt/host/source/chromite/lib/commandline.py", line 26, in <module>
    from chromite.lib import cros_build_lib
  File "/mnt/host/source/chromite/lib/cros_build_lib.py", line 12, in <module>
    import email.utils
  File "/usr/lib/python2.7/email/utils.py", line 27, in <module>
    import random
  File "/usr/lib/python2.7/random.py", line 49, in <module>
    import hashlib as _hashlib
  File "/usr/lib/python2.7/hashlib.py", line 138, in <module>
    _hashlib.openssl_md_meth_names)
AttributeError: 'module' object has no attribute 'openssl_md_meth_names'

 
Description: Show this description
Project Member

Comment 2 by bugdroid1@chromium.org, Mar 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/infra_virtualenv/+/d1311375caec2c0635bd73e3500534618aaa46e4

commit d1311375caec2c0635bd73e3500534618aaa46e4
Author: Allen Li <ayatane@google.com>
Date: Fri Mar 17 01:06:51 2017

Explicitly specify a Python for the virtualenv

This gives better guarantees on which python gets installed into the
virtualenv.

BUG= chromium:701914 
TEST=Run virtualenv tests

Change-Id: Ia331ba5706c0882fdf9812af1aa6f8e09bbb6c64
Reviewed-on: https://chromium-review.googlesource.com/455987
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>

[modify] https://crrev.com/d1311375caec2c0635bd73e3500534618aaa46e4/cros_venv/venvlib.py

Project Member

Comment 3 by bugdroid1@chromium.org, Mar 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/infra_virtualenv/+/1db23199f47110083d32de8ee3ef4297525b8464

commit 1db23199f47110083d32de8ee3ef4297525b8464
Author: Allen Li <ayatane@google.com>
Date: Fri Mar 17 01:06:51 2017

Add Python virtualenv version checking

If the virtualenv is installed with a version of Python the doesnt
match the system installed version of Python, subtle errors can
occur (see BUG).

BUG= chromium:701914 
TEST=Run venv tests

Change-Id: I6f4d98468e179ad2c40017463b527bd5d6f81605
Reviewed-on: https://chromium-review.googlesource.com/455988
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Chris Ching <chingcodes@chromium.org>

[modify] https://crrev.com/1db23199f47110083d32de8ee3ef4297525b8464/cros_venv/venvlib.py

Project Member

Comment 4 by bugdroid1@chromium.org, Mar 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/infra_virtualenv/+/0e8418ab1bffb172c09587fb77fe7e977e06c844

commit 0e8418ab1bffb172c09587fb77fe7e977e06c844
Author: Allen Li <ayatane@google.com>
Date: Fri Mar 17 01:06:51 2017

Merge virtualenv init checks

The site_package check is redundant with the virtualenv Python version
check

BUG= chromium:701914 
TEST=Run venv tests

Change-Id: I9e74ba48002e37de7384b609cc59da63dff8c292
Reviewed-on: https://chromium-review.googlesource.com/455989
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Allen Li <ayatane@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>

[modify] https://crrev.com/0e8418ab1bffb172c09587fb77fe7e977e06c844/cros_venv/venvlib.py

Status: Fixed (was: Untriaged)
Tentatively fixed for now.

Sign in to add a comment