[issue2090] __import__ with fromlist=

George Sakkis report at bugs.python.org
Fri Apr 16 00:51:33 CEST 2010


George Sakkis <george.sakkis at gmail.com> added the comment:

More fun findings: dots are special-cased too, but only if they don't appear consecutively (!);

~$ cat pkg/__init__.py
print  __name__

~$ python -c "__import__('pkg', fromlist=['.'])"
pkg
pkg..
~$ python -c "__import__('pkg', fromlist=['..'])"
pkg
~$ python -c "__import__('pkg', fromlist=['...'])"
pkg
~$ python -c "__import__('pkg', fromlist=['././//.'])"
pkg
pkg.././//.
~$ python -c "__import__('pkg', fromlist=['././../'])"
pkg

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2090>
_______________________________________


More information about the Python-bugs-list mailing list