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 <1499892469.14.0.484509481771.issue27487@psf.upfronthosting.co.za>
In-reply-to
Content
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](http://python-notes.curiousefficiency.org/en/latest/python_concepts/import_traps.html#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 (https://stackoverflow.com/questions/43393764/python-3-6-project-structure-leads-to-runtimewarning) 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/runpy.py", 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/runpy.py", line 125, in _get_module_details
    warn(RuntimeWarning(msg))
  File "/n/home00/lkelley/.conda/envs/py35/lib/python3.6/warnings.py", line 99, in _showwarnmsg
    msg.file, msg.line)
  File "/n/home00/lkelley/zcode/zcode/inout/inout_core.py", line 835, in warn_with_traceback
    traceback.print_stack()
/n/home00/lkelley/.conda/envs/py35/lib/python3.6/runpy.py:125: 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
  warn(RuntimeWarning(msg))
History
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: <1499892469.14.0.484509481771.issue27487@psf.upfronthosting.co.za>
2017-07-12 20:47:49lzkelleylinkissue27487 messages
2017-07-12 20:47:48lzkelleycreate