[tahoe-dev] startup error after upgrade

Daira Hopwood (formerly David-Sarah) david-sarah at jacaranda.org
Tue Apr 2 07:45:05 UTC 2013


On 30/03/13 00:37, Greg Troxel wrote:
> "Zooko Wilcox-O'Hearn" <zooko at zooko.com> writes:
> 
>> I thought the design flaw in question was:
>>
>> When you "import foo", and there are multiple modules named "foo" in your
>> filesystem, then which specific module you get is determined by a list of
>> directories, each of which can contain multiple modules. Therefore, when
>> you add a directory to the front of that list you are prioritizing *all* of
>> the modules in that directory over any other modules by the same name in
>> any other directories. Therefore, if a single directory contains both a
>> module you want to import and a module that you mustn't import (because it
>> name-collides with another module that you want to import), then you have
>> to make sure the *other* directory is earlier than this one on the list. If
>> there is a cycle of such dependencies, then it is impossible to import all
>> the modules that you require.
>>
>> That particular design flaw is built into the Python import mechanism, and
>> would still prevent you from importing the modules if there were no
>> distutils, pkg_resources, or setuptools on your system.
> 
> Sure, but the operative bug is less hard:
> 
>   When you run a program that is part of a package that is not
>   installed, it should be done so that the search path has the libraries
>   of the not-installed package first, so that when there is libfoo
>   installed as part of the previous-version foo package and libfoo as
>   part of the not-yet-installed version of the foo package, you get the
>   not-yet-installed version.
> 
> This is what libtool does.

I agree. But in practice it's more complicated than that because the .pth
files that are processed during imports can contain arbitrary Python code
(which is indeed a design flaw of the Python import mechanism itself, although
setuptools abuses it in a particularly egregious way). It makes my head hurt
just thinking about how broken it is.

-- 
Daira Hopwood ⚥  (formerly David-Sarah)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 555 bytes
Desc: OpenPGP digital signature
URL: <http://tahoe-lafs.org/pipermail/tahoe-dev/attachments/20130402/a68ae9dd/attachment.pgp>


More information about the tahoe-dev mailing list