[New-bugs-announce] [issue13304] test_site assumes that site.ENABLE_USER_SITE is True

Carl Meyer report at bugs.python.org
Mon Oct 31 19:31:08 CET 2011


New submission from Carl Meyer <carl at dirtcircle.com>:

If the test suite is run with PYTHONNOUSERSITE=true, the test_s_option test in test_site fails, because it implicitly assumes that site.ENABLE_USER_SITE is True and that site.USER_SITE should unconditionally be in sys.path.

This is a practical problem in the reference implementation for PEP 404, as the tests should pass when run from within a virtual environment, but a system-isolated virtual environment disables user-site (i.e. has the same effect as PYTHONNOUSERSITE).

I think the correct fix here is to conditionally skip that test if site.ENABLE_USER_SITE is not True.

I also think the module-level conditional check at the top of the file, which, if site.USER_SITE does not exist, creates site.USER_SITE and calls site.addsitedir() on it, should only run if site.ENABLE_USER_SITE is True.

----------
components: Tests
messages: 146722
nosy: carljm
priority: normal
severity: normal
status: open
title: test_site assumes that site.ENABLE_USER_SITE is True

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13304>
_______________________________________


More information about the New-bugs-announce mailing list