[issue18065] set __path__ = [] for frozen packages

2013-05-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 82db02a2e023 by Brett Cannon in branch 'default':
Issue #18065: For frozen packages set __path__ to [].
http://hg.python.org/cpython/rev/82db02a2e023

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18065
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18065] set __path__ = [] for frozen packages

2013-05-31 Thread Brett Cannon

Changes by Brett Cannon br...@python.org:


--
resolution:  - fixed
stage: test needed - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18065
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18065] set __path__ = [] for frozen packages

2013-05-28 Thread Barry A. Warsaw

Changes by Barry A. Warsaw ba...@python.org:


--
nosy: +barry

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18065
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18065] set __path__ = [] for frozen packages

2013-05-25 Thread Brett Cannon

New submission from Brett Cannon:

If you import the frozen __phello__ package, you will notice that 
__phello__.__path__ == ['__phello__']. While that seems innocuous, that could 
potentially lead to incorrect results if there just so happens to be a 
directory named __phello__ which contains a file that isn't a frozen submodule 
(i.e. FrozenImporter can't find the submodule but PathFinder can find a file 
that happens to match the module's name).

So for that reason I want to simply set __path__ = [] for frozen packages. The 
language reference for import states setting __path__ to anything makes a 
module a package and that it just needs to be an iterable that only returns 
strings (http://docs.python.org/3.4/reference/import.html#packages), so an 
empty list works. Plus __package__ contains the same information so there is no 
lost data by doing this.

Can anyone think of a good reason not to do this? I can't see why someone would 
be relying upon this for any reason since the existence of __path__ itself is 
enough to determine something is a package.

--
assignee: brett.cannon
components: Interpreter Core
messages: 190034
nosy: brett.cannon
priority: normal
severity: normal
stage: test needed
status: open
title: set __path__ = [] for frozen packages
type: behavior
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18065
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com