[Distutils] Bug? zimpimporter putting in a misleading co_filename?

Rocky Bernstein rocky.bernstein at gmail.com
Tue Dec 23 16:11:00 CET 2008

This is useful information and thanks for suggesting the workaround.

However this does not address the issue which is not about how I can create
an unzipped egg  for my use or the use of others. (Or what I did or didn't
do to create such an zipped egg).

I am interested in writing tools that work with both zipped an unzipped
eggs. To the extent that setuptools/distutils is responsible for setting the
co_filename field in the code object what should go inside that field? And
how can a programmer reliably and, if possible, uniformly untangle this to
get/report a location.

On Tue, Dec 23, 2008 at 9:14 AM, zooko <zooko at zooko.com> wrote:

> On Dec 22, 2008, at 20:51 PM, Rocky Bernstein wrote:
>  I recently cut over to using distutils to distribute open-source software.
>> distutils decided to create an zipimporter egg. (Well, I'm sure it did what
>> it did for good reason, I just am not all that aware of what I did to cause
>> it too choose that.) When I inspect functions in that egg they seem to have
>> a path that doesn't really exist. Is there something I did to create this
>> improperly or perhaps this just they things are?
> This is one of the parts of issue33:
> http://bugs.python.org/setuptools/issue33
> I just added the following comment to that issue ticket:
> Suggested workaround for people finding this ticket from a search engine
> query
> such as "distutils zip problem":
> 1.  Put the following in your distutils config file:
> {{{
> [easy_install]
> zip_ok=False
> }}}
> Then all packages that you easy_install will be unzipped.
> 2.  When creating a package for others, pass {{{zip_ok=False}}} to
> {{{setup()}}}.  This is a bit nasty, because that flag is really supposed
> to
> indicate whether there is something in the package that can't work from
> zip, and
> if you set that flag then this abrogrates the user's preference when
> installing
> -- there is no way for them to tell easy_install to install the package
> zippedin spite of the {{{zip_ok=False}}} flag.  However, I have seen so many
> reports
> of problems with zip files, and zero reports of problems with unzipped
> files,
> and zero requests for zipped files, so I'm personally comfortable setting
> {{{zip_ok=False}}} just to help the user avoid the problems.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20081223/a8eb8f01/attachment.htm>

More information about the Distutils-SIG mailing list