classification
Title: import __hello__ is broken in Python 3
Type: Stage:
Components: Versions: Python 3.4, Python 3.1, Python 3.2, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Trundle, benjamin.peterson, ezio.melotti, georg.brandl, haypo, merwok, python-dev
Priority: deferred blocker Keywords: patch

Created on 2011-03-20 15:15 by haypo, last changed 2011-05-16 23:19 by python-dev. This issue is now closed.

Files
File name Uploaded Description Edit
issue11614.patch Trundle, 2011-05-12 21:24 review
issue11614_!.patch Trundle, 2011-05-12 22:19 review
Messages (16)
msg131499 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2011-03-20 15:15
import __hello__ doesn't print any message!!!
msg131500 - (view) Author: Andreas Stührk (Trundle) * Date: 2011-03-20 15:33
That was changed in [a2213060d9dd], see issue #1414.
msg132123 - (view) Author: Éric Araujo (merwok) * (Python committer) Date: 2011-03-25 17:47
What’s import __hello__?  I don’t have it in any version from 2.4 to 3.2.
msg132127 - (view) Author: Éric Araujo (merwok) * (Python committer) Date: 2011-03-25 17:52
Okay, it doesn’t work with -m __hello__, but using -c "import __hello__" I can see the message in all versions.
msg132221 - (view) Author: Andreas Stührk (Trundle) * Date: 2011-03-26 10:01
On Fri, Mar 25, 2011 at 5:52 PM, Éric Araujo <report@bugs.python.org> wrote:
> Okay, it doesn’t work with -m __hello__, but using -c "import __hello__" I can see the message in all versions.

Can you elaborate on that? I.e. the versions and the actual message.
The current bytecode of the __hello__ module is (default branch):

  1           0 LOAD_CONST               1 (True)
              3 STORE_NAME               1 (initialized)
              6 LOAD_CONST               0 (None)
              9 RETURN_VALUE

I'd be a bit surprised if that really prints a message.
msg132370 - (view) Author: Éric Araujo (merwok) * (Python committer) Date: 2011-03-27 22:07
I can see the message (“Hello world...”) in 2.4 to 2.7, but actually not in 3.x.
msg135860 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2011-05-12 20:36
Why is this still open, and more importantly, why is it a release blocker?
msg135864 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2011-05-12 20:44
> Why is this still open

Because import __hello__ doesn't print hello.

> and more importantly, why is it a release blocker?

Because it is a very important issue!
msg135868 - (view) Author: Andreas Stührk (Trundle) * Date: 2011-05-12 21:24
A patch against 3.1. The new bytecode is now:

  1           0 LOAD_CONST               2 (True) 
              3 STORE_NAME               1 (initialized) 

  2           6 LOAD_NAME                2 (print) 
              9 LOAD_CONST               0 ('Hello world...') 
             12 CALL_FUNCTION            1 
             15 POP_TOP              
             16 LOAD_CONST               1 (None) 
             19 RETURN_VALUE
msg135869 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2011-05-12 21:40
+print("Hello world...")

I would prefer a more positive "Hello World!", but thanks for the patch.
msg136095 - (view) Author: Roundup Robot (python-dev) Date: 2011-05-16 14:35
New changeset 44fd95cead7b by Victor Stinner in branch '3.1':
Issue #11614: import __hello__ prints "Hello World!". Patch written by Andreas
http://hg.python.org/cpython/rev/44fd95cead7b

New changeset 2c5736e8a221 by Victor Stinner in branch '3.2':
(Merge 3.1) Issue #11614: import __hello__ prints "Hello World!". Patch written
http://hg.python.org/cpython/rev/2c5736e8a221

New changeset 79c49d2fc768 by Victor Stinner in branch 'default':
(Merge 3.2) Issue #11614: import __hello__ prints "Hello World!". Patch written
http://hg.python.org/cpython/rev/79c49d2fc768
msg136096 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2011-05-16 14:37
Thanks Andreas for your fix! Python 3 is now better than Python 2: it prints "Hello World!" instead of "Hello World...".
msg136101 - (view) Author: Roundup Robot (python-dev) Date: 2011-05-16 15:01
New changeset 9e1d7cd15d2e by Victor Stinner in branch '3.1':
Issue #11614: Fix importlib tests for the new __hello__ module
http://hg.python.org/cpython/rev/9e1d7cd15d2e

New changeset 6119f6cc9b2d by Victor Stinner in branch '3.2':
(Merge 3.1) Issue #11614: Fix importlib tests for the new __hello__ module
http://hg.python.org/cpython/rev/6119f6cc9b2d

New changeset b61a1cd4943b by Victor Stinner in branch 'default':
(Merge 3.2) Issue #11614: Fix importlib tests for the new __hello__ module
http://hg.python.org/cpython/rev/b61a1cd4943b
msg136105 - (view) Author: Roundup Robot (python-dev) Date: 2011-05-16 15:20
New changeset 9a4d4506680a by Victor Stinner in branch '3.1':
Issue #11614: Fix test_linecache, cjkencodings_test.py doesn't exist anymore
http://hg.python.org/cpython/rev/9a4d4506680a

New changeset 43cbfacae463 by Victor Stinner in branch '3.2':
(Merge 3.1) Issue #11614: Fix test_linecache, cjkencodings_test.py doesn't
http://hg.python.org/cpython/rev/43cbfacae463

New changeset 06473da99270 by Victor Stinner in branch 'default':
(Merge 3.2) Issue #11614: Fix test_linecache, cjkencodings_test.py doesn't
http://hg.python.org/cpython/rev/06473da99270
msg136107 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2011-05-16 15:23
> New changeset 9a4d4506680a by Victor Stinner in branch '3.1':
> Issue #11614: Fix test_linecache, cjkencodings_test.py doesn't exist anymore

Oh, these commits are related to #12057, not this one.
msg136131 - (view) Author: Roundup Robot (python-dev) Date: 2011-05-16 23:19
New changeset 47bc3509f76b by Victor Stinner in branch '2.7':
Issue #11614: Fix test_linecache, cjkencodings_test.py doesn't exist anymore
http://hg.python.org/cpython/rev/47bc3509f76b
History
Date User Action Args
2011-05-16 23:19:23python-devsetmessages: + msg136131
2011-05-16 15:23:33hayposetmessages: + msg136107
2011-05-16 15:20:54python-devsetmessages: + msg136105
2011-05-16 15:01:28python-devsetmessages: + msg136101
2011-05-16 14:37:02hayposetstatus: open -> closed
resolution: fixed
messages: + msg136096
2011-05-16 14:35:46python-devsetnosy: + python-dev
messages: + msg136095
2011-05-15 15:47:54georg.brandlsetpriority: release blocker -> deferred blocker
2011-05-12 22:19:03Trundlesetfiles: + issue11614_!.patch
2011-05-12 21:40:18hayposetmessages: + msg135869
2011-05-12 21:24:52Trundlesetfiles: + issue11614.patch
keywords: + patch
messages: + msg135868
2011-05-12 20:44:53hayposetmessages: + msg135864
2011-05-12 20:36:28georg.brandlsetmessages: + msg135860
2011-03-27 22:07:08merwoksetmessages: + msg132370
2011-03-26 10:01:16Trundlesetmessages: + msg132221
2011-03-25 18:15:07ezio.melottisetnosy: + ezio.melotti
2011-03-25 17:52:48merwoksetmessages: + msg132127
2011-03-25 17:47:42merwoksetnosy: + merwok
messages: + msg132123
2011-03-20 15:33:04Trundlesetnosy: + Trundle
messages: + msg131500
2011-03-20 15:15:10haypocreate