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 torsten
Recipients brett.cannon, pitrou, remram, torsten
Date 2016-09-14.11:18:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1473851892.5.0.00921475920402.issue22543@psf.upfronthosting.co.za>
In-reply-to
Content
Wow, this was news to me and I just ran into it in python 2.7. Checked in Python 3 and it's still there:

```
(py3)->torsten.landschoff@horatio:~$ python3 --version
Python 3.6.0a3+
(py3)->torsten.landschoff@horatio:~$ python3 -W error::sqlalchemy.exc.SAWarning -c "print()"
Invalid -W option ignored: invalid module name: 'sqlalchemy.exc'

```

I see no easy way to fix this. One way I thought about is to have hooks for importing of modules (called when a module is put into ``sys.modules``, not sure if there is something like this already) and have the warning system trigger on that.

There is no way to raise an exception before it is imported anyway...
History
Date User Action Args
2016-09-14 11:18:12torstensetrecipients: + torsten, brett.cannon, pitrou, remram
2016-09-14 11:18:12torstensetmessageid: <1473851892.5.0.00921475920402.issue22543@psf.upfronthosting.co.za>
2016-09-14 11:18:12torstenlinkissue22543 messages
2016-09-14 11:18:12torstencreate