fixes given by Glenn Linderman

This commit is contained in:
Barry Warsaw 2010-02-27 16:51:29 +00:00
parent 01a25b00f2
commit 5b4ff3044b
1 changed files with 12 additions and 11 deletions

View File

@ -128,7 +128,7 @@ After byte compiling this package with Python 3.2, you would see the
following layout::
alpha/
__pycache__
__pycache__/
__init__.cpython-32.pyc
one.cpython-32.pyc
two.cpython-32.pyc
@ -136,7 +136,7 @@ following layout::
one.py
two.py
beta/
__pycache__
__pycache__/
__init__.cpython-32.pyc
three.cpython-32.pyc
four.cpython-32.pyc
@ -149,7 +149,7 @@ Let's say that two new versions of Python are installed, one is Python
system would look like this::
alpha/
__pycache__
__pycache__/
__init__.cpython-32.pyc
__init__.cpython-33.pyc
__init__.unladen-10.pyc
@ -163,7 +163,7 @@ system would look like this::
one.py
two.py
beta/
__pycache__
__pycache__/
__init__.cpython-32.pyc
__init__.cpython-33.pyc
__init__.unladen-10.pyc
@ -186,12 +186,12 @@ can generally be ignored, such that a normal directory listing would
show something like this::
alpha/
__pycache__
__pycache__/
__init__.py
one.py
two.py
beta/
__pycache__
__pycache__/
__init__.py
three.py
four.py
@ -233,20 +233,21 @@ looks for a matching `__pycache__/foo.<magic>.pyc` and finding this,
it reads the byte code and continues as usual.
Case 3: __pycache__/foo.pyc with no source
Case 3: __pycache__/foo.<magic>.pyc with no source
------------------------------------------
It's possible that the `foo.py` file somehow got removed, while
leaving the cached pyc file still on the file system. If the
`__pycache__/foo.pyc` file exists, but the `foo.py` file used to
create it does not, Python will raise an `ImportError` when asked to
import foo. In other words, by default, Python will not support
`__pycache__/foo.<magic>.pyc` file exists, but the `foo.py` file used
to create it does not, Python will raise an `ImportError` when asked
to import foo. In other words, by default, Python will not support
importing a module unless the source file exists.
Python users who want to deploy sourceless imports are instructed to
create a custom importer that supports this behavior. Options include
importing pycs from a zip file, or locating pyc files where the py
source file would have existed.
source file would have existed. (See the Open Issues section for more
discussion.)
Case 4: legacy pyc files