[Python-checkins] r55659 - in python/branches/bcannon-objcap: BRANCH_NOTES tests/fail/hidden_modules.py tests/succeed/import_safe_builtin.py
brett.cannon
python-checkins at python.org
Wed May 30 00:09:21 CEST 2007
Author: brett.cannon
Date: Wed May 30 00:09:13 2007
New Revision: 55659
Added:
python/branches/bcannon-objcap/tests/fail/hidden_modules.py (contents, props changed)
Modified:
python/branches/bcannon-objcap/BRANCH_NOTES
python/branches/bcannon-objcap/tests/succeed/import_safe_builtin.py
Log:
Test that modules moved into .hidden cannot be imported again unless they are
whitelisted.
Modified: python/branches/bcannon-objcap/BRANCH_NOTES
==============================================================================
--- python/branches/bcannon-objcap/BRANCH_NOTES (original)
+++ python/branches/bcannon-objcap/BRANCH_NOTES Wed May 30 00:09:13 2007
@@ -37,8 +37,6 @@
+ Delegate protects importlib.
+ Whitelisting works.
* Name fall-through to alternate implementation.
- + Removed modules cannot be imported (unless whitelisted).
- - Thoroughly look for open and execfile.
==========
Added: python/branches/bcannon-objcap/tests/fail/hidden_modules.py
==============================================================================
--- (empty file)
+++ python/branches/bcannon-objcap/tests/fail/hidden_modules.py Wed May 30 00:09:13 2007
@@ -0,0 +1,8 @@
+"""Modules that have been hidden (and stored into .hidden) should not be
+reachable unless they were whitelisted."""
+try:
+ import posix
+except ImportError:
+ pass
+else:
+ raise Exception
Modified: python/branches/bcannon-objcap/tests/succeed/import_safe_builtin.py
==============================================================================
--- python/branches/bcannon-objcap/tests/succeed/import_safe_builtin.py (original)
+++ python/branches/bcannon-objcap/tests/succeed/import_safe_builtin.py Wed May 30 00:09:13 2007
@@ -2,6 +2,7 @@
import _ast
import _codecs
import _sre
+# Also tests that modules moved to .hidden can be imported again.
import _types
import errno
import exceptions
More information about the Python-checkins
mailing list