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 lzkelley
Recipients brett.cannon, eric.snow, larry, lzkelley, martin.panter, ncoghlan, ned.deily, python-dev, wolma
Date 2017-07-12.20:47:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I recently started getting this warning message (see bottom) that seems to be due to the changes from this issue.  I'm running a submodule as main using the `-m` flag, but I'm not doing any modification to `sys.modules`, or even `sys.path`...  I've taken a look at [The double-import trap](, but it doesn't really seem to apply.  I really have no idea how to go about debugging this.

1) Would it be possible for the warning to include information about how/where the double import is happening?

2) Are there other, common ways of this occurring when the `sys` module isn't being messed with?

The issue on stackexchange ( seems similar, although this one in particular isn't reproducible.

Any help would be greatly appreciated.  Thanks!

File "/n/home00/lkelley/.conda/envs/py35/lib/python3.6/", line 183, in _run_module_as_main
    mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
  File "/n/home00/lkelley/.conda/envs/py35/lib/python3.6/", line 125, in _get_module_details
  File "/n/home00/lkelley/.conda/envs/py35/lib/python3.6/", line 99, in _showwarnmsg
    msg.file, msg.line)
  File "/n/home00/lkelley/zcode/zcode/inout/", line 835, in warn_with_traceback
/n/home00/lkelley/.conda/envs/py35/lib/python3.6/ RuntimeWarning: 'mbhmergers.gwb.deterministic.grid_calc' found in sys.modules after import of package 'mbhmergers.gwb.deterministic', but prior to execution of 'mbhmergers.gwb.deterministic.grid_calc'; this may result in unpredictable behaviour
Date User Action Args
2017-07-12 20:47:49lzkelleysetrecipients: + lzkelley, brett.cannon, ncoghlan, larry, ned.deily, python-dev, eric.snow, martin.panter, wolma
2017-07-12 20:47:49lzkelleysetmessageid: <>
2017-07-12 20:47:49lzkelleylinkissue27487 messages
2017-07-12 20:47:48lzkelleycreate