[issue2090] __import__ with fromlist=[''] causes double initialization of modules

2008-03-19 Thread hauser

hauser <[EMAIL PROTECTED]> added the comment:

There are quite a few projects that use this solution:
http://google.com/codesearch?hl=en&lr=&q=__import__.*%5C%5B%27%27%5C%5D
. I would change it even if it is a hack, but I understand your point.

--
versions: +Python 2.5

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2090>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue2090] __import__ with fromlist=[''] causes double initialization of modules

2008-02-12 Thread hauser

New submission from hauser:

This construction:

__import__( 'pkg', {}, {}, [''] )

Will cause double initialization of package 'pkg', once with name 'pkg'
and second one with name 'pkg.' (trailing dot). Implementation tries to
import subpackage of 'pkg' with empty name, and imports the same package
twice.

This kind of construction is used as a hacky way to obtain exact module
instead of top-level module in return value. It is a hack, but should
not cause this kind of side effects.

--
components: Interpreter Core
files: empty_import.tgz
messages: 62333
nosy: hauser
severity: minor
status: open
title: __import__ with fromlist=[''] causes double initialization of modules
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file9420/empty_import.tgz

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2090>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com