What are the reserved Python module/package names?
<p>I got a strange error while working with Python unittest.  I have two folders in my project:</p>

<pre><code>project
    code
        __init__.py        (empty)
        app.py             (defines my App class)
    test
        test.py            (contains my unit tests)
</code></pre>

<p>test.py is:</p>

<pre><code>import os, sys, unittest
sys.path.insert(1, os.path.join(sys.path[0],'..'))
from code.app import App

class test_func1(unittest.TestCase):
    ...
</code></pre>

<p>When I run test.py I get the message:</p>

<pre><code>Traceback (most recent call last):
    File "&lt;frozen importlib._bootstrap&gt;", line 2218, in _find_and_load_unlocked
AttributeError: 'module' object has no attribute '__path__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "...test.py, line 5, in &lt;module&gt;
    from code.app import App
ImportError: No module named 'code.app': 'code' is not a package
</code></pre>

<p>After verifying that <code>__init__.py</code> was present and banging my head for a while, on a whim I changed the name of the app directory from code to prog:</p>

<pre><code>import os, sys, unittest
sys.path.insert(1, os.path.join(sys.path[0],'..'))
from prog.app import App
</code></pre>

<p>... and everything was suddenly fine.  Unittest imported my app properly and ran the tests.</p>

<p>I've searched through <a href="https://docs.python.org/3.5/reference/lexical_analysis.html#keywords" rel="nofollow">https://docs.python.org/3.5/reference/lexical_analysis.html#keywords</a> and <a href="https://docs.python.org/3/reference/import.html#path-entry-finders" rel="nofollow">https://docs.python.org/3/reference/import.html#path-entry-finders</a> and don't see any indication that <code>code</code> is an illegal directory name.   Where would this be documented, and what other directory names are reserved?</p>

<p>System: python 3.4.3 [MSC v1600 32 bit] on win32, Windows 7</p>