[New-bugs-announce] [issue10955] Possible regression with stdlib in zipfile

Ronald Oussoren report at bugs.python.org
Thu Jan 20 14:52:20 CET 2011

New submission from Ronald Oussoren <ronaldoussoren at mac.com>:

I ran into this issue while debugging why py2app doesn't work with python 3.2rc2. The reason seems to be a regression w.r.t. having the stdlib inside a zipfile.

Note that I haven't tested this without going through py2app yet.

py2app basicly recreates a minimal sys.prefix that contains just the application python files and a minimal selection of files from the stdlib.

The file structure in the app bundle contains (for python3.2):

               python32.zip   # Most compiled python files
               python3.2/     # Files that cannot be in the zip
                  lib-dynload # Extensions

This structure works fine with python2.7 (and earlier) and python3.1, with python 3.2rc2 I get a bootstrap error because the filesystem encoding codec cannot be located.

This can be worked around by moving the encodings package and the codecs module from the zipfile to the python3.2 directory. 

That however is not good enough, I also have to change the default search-path using Py_SetPath. The default path has python32.zip before the python3.2 directory, only when I switch those around the application loads fine.

All of this is on MacOSX 10.6.6 (where the filesystem encoding is UTF-8).

This is a regression because it is no longer possible to have a packaged python application where all python code is inside a zipfile. Some files must be outside of the file to bootstrap the interpreter.

messages: 126614
nosy: ronaldoussoren
priority: normal
severity: normal
stage: unit test needed
status: open
title: Possible regression with stdlib in zipfile
type: behavior
versions: Python 3.2

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list