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

nesting venv in virtualenv segfaults #70391

Closed
AndrCaron mannequin opened this issue Jan 25, 2016 · 2 comments
Closed

nesting venv in virtualenv segfaults #70391

AndrCaron mannequin opened this issue Jan 25, 2016 · 2 comments
Labels
stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@AndrCaron
Copy link
Mannequin

AndrCaron mannequin commented Jan 25, 2016

BPO 26203
Nosy @vsajip, @carljm, @dstufft, @The-Compiler

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 2016-01-26.17:32:53.568>
created_at = <Date 2016-01-25.21:06:30.311>
labels = ['invalid', 'library', 'type-crash']
title = 'nesting venv in virtualenv segfaults'
updated_at = <Date 2016-01-26.17:32:53.568>
user = 'https://bugs.python.org/AndrCaron'

bugs.python.org fields:

activity = <Date 2016-01-26.17:32:53.568>
actor = 'brett.cannon'
assignee = 'none'
closed = True
closed_date = <Date 2016-01-26.17:32:53.568>
closer = 'brett.cannon'
components = ['Library (Lib)']
creation = <Date 2016-01-25.21:06:30.311>
creator = 'Andr\xc3\xa9 Caron'
dependencies = []
files = []
hgrepos = []
issue_num = 26203
keywords = []
message_count = 2.0
messages = ['258923', '258934']
nosy_count = 5.0
nosy_names = ['vinay.sajip', 'carljm', 'dstufft', 'The Compiler', 'Andr\xc3\xa9 Caron']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = 'crash'
url = 'https://bugs.python.org/issue26203'
versions = ['Python 3.5']

@AndrCaron
Copy link
Mannequin Author

AndrCaron mannequin commented Jan 25, 2016

When trying to create a new virtual environment using Python 3.5's venv package from a virtual environment created by the popular 3rd-party virtualenv package, I get a segfault.

Nested virtual environments work fine both with venv and virtualenv, but using one inside the other doesn't work. This suggests a subtle incompatibility between the two implementations.

I'm not sure whether compatibility between the implementations is a goal or not at the moment, but there is extensive tooling that uses the 3rd party virtualenv implementation. For example, I run tests with Tox, which uses virtualenv. I cannot test any package that uses the standard venv because everything crashes. As a result of this, I will avoid moving to the standard implementation.

I put up some sample scripts up on GitHub to show how to reproduce the issue. I hope they can help explain the issue.

https://github.com/AndreLouisCaron/nested-venv-bug

Cheers,

André

@AndrCaron AndrCaron mannequin added stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump labels Jan 25, 2016
@vsajip
Copy link
Member

vsajip commented Jan 26, 2016

By design, the stdlib venv functionality expects to work from an installed Python. However, the Python in a virtualenv venv is not an installed Python - it copies some files from the Python it was installed from and does various other hacks in order to work (I'm not using 'hack' as a pejorative here - it's just what virtualenv has to do).

Thus, you cannot use venv to create an environment from a virtualenv venv's Python. For this to work seamlessly, there would probably need to be coupling between venv and virtualenv - virtualenv has potentially to be updated with additional hacks every time there is a new Python release, in order to keep working.

It doesn't make sense to couple the stdlib closely with a third-party package. Does it work the other way around? I realise this doesn't help you with tox, and of course tox has to use virtualenv because of supporting older versions of Python ...

@vsajip vsajip added the invalid label Jan 26, 2016
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
Development

No branches or pull requests

2 participants