[issue25970] py_compile.compile fails if existing bytecode file is unwritable

2015-12-28 Thread Robert Byrnes

New submission from Robert Byrnes:

In Python/import.c, open_exclusive unlinks any existing bytecode file before 
opening to create a new one.

However, py_compile.compile doesn't unlink before opening, and therefore fails 
if an existing bytecode file is unwritable.  It would be nice to unlink first 
in this case too.

--
components: Library (Lib)
messages: 257142
nosy: byrnes
priority: normal
severity: normal
status: open
title: py_compile.compile fails if existing bytecode file is unwritable
type: behavior
versions: Python 2.7

___
Python tracker 
<http://bugs.python.org/issue25970>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25711] Rewrite zipimport from scratch

2015-11-23 Thread Robert Byrnes

Changes by Robert Byrnes :


--
nosy: +byrnes

___
Python tracker 
<http://bugs.python.org/issue25711>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25710] zipimport is not PEP 3147 or PEP 488 compliant

2015-11-23 Thread Robert Byrnes

New submission from Robert Byrnes:

zipimport is not PEP 3147 compliant: i.e., it looks for foo.pyc (in the same 
directory as foo.py) instead of __pycache__/foo.cpython-35.pyc.  This is 
counterintuitive, and unfortunate because it means that installation 
directories (that obey PEP 3147 conventions) can't be zip archived from 
filesystems and then used by zipimport.

When support for PEP 488 was added to Python 3.5, zipimport was modified to 
just delete references to .pyo files, but it needs to know about the new 
.opt-[12] filename components (as well as the PEP 3147 version tags).  As far 
as I can tell, the current version of zipimport can't import optimized bytecode 
files, using either the old or new filename conventions.

Finally, none of this behavior is documented.  The zipimport docs still mention 
.pyo files (which were eliminated by PEP 488), and say nothing about the 
filename conventions expected within zip archives.

--
components: Extension Modules
messages: 255178
nosy: byrnes
priority: normal
severity: normal
status: open
title: zipimport is not PEP 3147 or PEP 488 compliant
type: behavior
versions: Python 3.6

___
Python tracker 
<http://bugs.python.org/issue25710>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com