New submission from Wolfgang Langner:

In site.py there is the internal function _init_pathinfo() This function builds 
a set of path entries from sys.path. This is used to avoid duplicate entries in 
sys.path.
But this function has a check if it is a directory with os.path.isdir(...). All 
this is fine as long as someone has a .zip file in sys.path or a zipfile 
subpath. Then the path entry is not part of the set. With this duplicate 
detection with none directories does not work.

The fix is as simple as removing the os.path.isdir(...) line and fixing the 
indent. Also the docstring should be modified.

Detected by using this function in a project reusing addsitedir(...) 
functionality to add another path with .pth processing.

----------
components: Library (Lib)
messages: 261958
nosy: tds333
priority: normal
severity: normal
status: open
title: Possible duplicate entries in sys.path if .pth files are used with zip's
type: enhancement
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26587>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to