Created
December 5, 2008 00:53
-
-
Save dreiss/32180 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir pytest | |
$ cd pytest | |
$ mkdir src | |
$ mkdir stage | |
$ mkdir src/mylib | |
$ touch src/mylib/__init__.py | |
$ echo 'import mylib' > src/myscript.py | |
$ cd src | |
$ zip mypar.zip mylib/__init__.py myscript.py | |
adding: mylib/__init__.py (stored 0%) | |
adding: myscript.py (stored 0%) | |
$ mv mypar.zip .. | |
$ cd .. | |
$ mv mypar.zip stage | |
$ cd stage | |
$ mkdir mylib | |
$ env PYTHONPATH=$PWD/mypar.zip python -m myscript | |
Traceback (most recent call last): | |
File "/var/tmp/Python-1-fb-buildroot/usr/local/lib/python2.6/runpy.py", line 121, in _run_module_as_main | |
"__main__", fname, loader, pkg_name) | |
File "/var/tmp/Python-1-fb-buildroot/usr/local/lib/python2.6/runpy.py", line 34, in _run_code | |
exec code in run_globals | |
File "/home/dreiss/pytest/stage/mypar.zip/myscript.py", line 1, in <module> | |
TypeError: expected string or Unicode object, NoneType found | |
$ env PYTHONPATH=$PWD/mypar.zip python ../src/myscript.py | |
$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment