[issue29326] Blank lines in ._pth file are not ignored

Alexey Izbyshev report at bugs.python.org
Fri Jan 27 10:04:28 EST 2017


Alexey Izbyshev added the comment:

I've encountered this issue too. (FYI, the official 3.6.0 embeddable zip from https://www.python.org/downloads/windows/ does contain a blank line in its ._pth, so all its users get an invalid entry in sys.path).

The patch is attached. I couldn't fix tests in more straightforward way because both of them were broken:
* Both of them generated ._pth with 'import site'
* Both of them checked for zero exit code instead of non-zero one, but both passed because predicates in sys.exit() were incorrect

I've strengthened the check in 'nosite' test because it is trivial to fully emulate sys.path calculation logic in this case. I've preserved weaker checks in the other test because I didn't want to emulate site.py logic.

----------
nosy: +izbyshev
Added file: http://bugs.python.org/file46433/underpth_blank_lines.diff

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


More information about the Python-bugs-list mailing list