[jslagle@teletran-1 ~]$ python
Python 2.7.5 (default, Jun 25 2014, 10:19:55)
[GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, sys
>>> sys.path.insert(0, '/home/jslagle/code/github/slagle/openstack/osprofiler/osprofiler/../../osprofiler')
>>> import osprofiler
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/jslagle/code/github/slagle/openstack/osprofiler/osprofiler/../../osprofiler/osprofiler/__init__.py", line 23, in <module>
utils.import_modules_from_package("osprofiler._notifiers")
File "/home/jslagle/code/github/slagle/openstack/osprofiler/osprofiler/../../osprofiler/osprofiler/_utils.py", line 172, in import_modules_from_package
__import__(module_name)
ValueError: Empty module name
That value inserted into sys.path is a real path, and valid for entry into sys.path.
I'd work on a patch (in fact I wrote a failing test case), but I really don't understand the intent behind the split on "...." in this function in _utils.py.
Here's a pretty simple reproducer:
[jslagle@teletran-1 ~]$ python jslagle/ code/github/ slagle/ openstack/ osprofiler/ osprofiler/ ../../osprofile r') jslagle/ code/github/ slagle/ openstack/ osprofiler/ osprofiler/ ../../osprofile r/osprofiler/ __init_ _.py", line 23, in <module> import_ modules_ from_package( "osprofiler. _notifiers" ) jslagle/ code/github/ slagle/ openstack/ osprofiler/ osprofiler/ ../../osprofile r/osprofiler/ _utils. py", line 172, in import_ modules_ from_package _(module_ name)
Python 2.7.5 (default, Jun 25 2014, 10:19:55)
[GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os, sys
>>> sys.path.insert(0, '/home/
>>> import osprofiler
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/
utils.
File "/home/
__import_
ValueError: Empty module name
That value inserted into sys.path is a real path, and valid for entry into sys.path.
I'd work on a patch (in fact I wrote a failing test case), but I really don't understand the intent behind the split on "...." in this function in _utils.py.