This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: from distutils.util import byte_compile hangs
Type: behavior Stage: resolved
Components: Distutils Versions: Python 3.3
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: Dmitry.Sivachenko, eric.araujo, tarek, vishnubob
Priority: normal Keywords:

Created on 2013-04-05 14:31 by Dmitry.Sivachenko, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (5)
msg186084 - (view) Author: Dmitry Sivachenko (Dmitry.Sivachenko) Date: 2013-04-05 14:31
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 <module>
    from distutils.util import byte_compile
  File "/usr/local/lib/python3.3/distutils/util.py", line 9, in <module>
    import imp
  File "/usr/local/lib/python3.3/imp.py", line 28, in <module>
    import tokenize
  File "/usr/local/lib/python3.3/tokenize.py", line 37, in <module>
    __all__ = token.__all__ + ["COMMENT", "tokenize", "detect_encoding",
AttributeError: 'module' object has no attribute '__all__'
msg186754 - (view) Author: Giles Hall (vishnubob) Date: 2013-04-13 16:38
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.
msg186759 - (view) Author: Dmitry Sivachenko (Dmitry.Sivachenko) Date: 2013-04-13 16:50
No, I meant Ctrl+D.
I use FreeBSD-10.
msg186761 - (view) Author: Giles Hall (vishnubob) Date: 2013-04-13 17:01
Hi Dmitry, since I can't replicate your issue, can you provide any more context from GDB and/or strace/ktrace?  Thanks!
msg213222 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2014-03-12 08:50
Can’t reproduce (linux 3.12).  If someone on FreeBSD can reproduce the bug, please reopen this ticket.
History
Date User Action Args
2022-04-11 14:57:43adminsetgithub: 61840
2014-03-12 08:50:12eric.araujosetstatus: open -> closed
resolution: works for me
messages: + msg213222

stage: resolved
2013-04-13 17:01:10vishnubobsetmessages: + msg186761
2013-04-13 16:50:21Dmitry.Sivachenkosetmessages: + msg186759
2013-04-13 16:38:57vishnubobsetnosy: + vishnubob
messages: + msg186754
2013-04-05 14:31:26Dmitry.Sivachenkocreate