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.

Author Segev Finer
Recipients Segev Finer
Date 2018-01-09.21:12:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1515532370.23.0.467229070634.issue32524@psf.upfronthosting.co.za>
In-reply-to
Content
With the file hello/__init__.py:

    ham = 123
    spam()spam()

I get the following:

    Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import hello
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "hello\__init__.py", line 2
        spam()spam()
                 ^
    SyntaxError: invalid syntax
    >>> import hello
    >>> print hello
    <module 'hello' from 'hello'>
    >>> print dir(hello)
    ['__doc__', '__file__', '__name__', '__package__', '__path__']
    >>>

I'd expect to get the SyntaxError twice, which is indeed what happens on at least Python 3.6 (Possibly earlier Python 3 versions).

Originally found here https://github.com/pallets/flask/issues/2423 & https://github.com/pallets/flask/pull/2588

I'm going to submit a PR with a fix.
History
Date User Action Args
2018-01-09 21:12:50Segev Finersetrecipients: + Segev Finer
2018-01-09 21:12:50Segev Finersetmessageid: <1515532370.23.0.467229070634.issue32524@psf.upfronthosting.co.za>
2018-01-09 21:12:50Segev Finerlinkissue32524 messages
2018-01-09 21:12:49Segev Finercreate