Issue 17640: from distutils.util import byte_compile hangs (original) (raw)
The following problem exists in python3.3.0 and python3.3.1rc1.
From the command line it works:
root@dhcp175-40-red:~ # python3 Python 3.3.1rc1 (default, Apr 5 2013, 18:03:56) [GCC 4.2.1 20070831 patched [FreeBSD]] on freebsd10 Type "help", "copyright", "credits" or "license" for more information.
from distutils.util import byte_compile
From script it hangs: root@dhcp175-40-red:~ # cat /tmp/comp.py from distutils.util import byte_compile files = [ '/usr/local/lib/python3.3/site-packages/yaml/init.py',]
byte_compile(files, optimize=1, force=None, prefix=None, base_dir=None, verbose=1, dry_run=0, direct=1)
python3 /tmp/comp.py
--> Now it hangs forever, if I press Ctrl+D, I get: Traceback (most recent call last): File "/tmp/comp.py", line 1, in from distutils.util import byte_compile File "/usr/local/lib/python3.3/distutils/util.py", line 9, in import imp File "/usr/local/lib/python3.3/imp.py", line 28, in import tokenize File "/usr/local/lib/python3.3/tokenize.py", line 37, in all = token.all + ["COMMENT", "tokenize", "detect_encoding", AttributeError: 'module' object has no attribute 'all'
I was unable to replicate this bug with clean builds of either Python3.3.0 and Python3.3.1rc1 on either Linux or OSX. I assume you also meant Ctrl-C, since there is no reading from standard input occurring in this script. Without further data such as platform/vendor information, an strace, or a secondary confirmation of this behavior, I would suggest closing this bug.
My test environment on Linux was Ubuntu 12.10, Linux 3.2.0-34-generic, 2.15glibc. On OSX, I'm running 10.7.5 with the latest command line build tools.