[Distutils] setuptools: Missing unmanaged module warning; Failed SVN cleanup; Wrong version in .egg name

John J Lee jjl at pobox.com
Tue Nov 1 20:02:05 CET 2005


On Tue, 1 Nov 2005, John J Lee wrote:

> On Tue, 1 Nov 2005, Phillip J. Eby wrote:
> [...]
>> I wonder what the permission problem is, and if perhaps it could be fixed by
>> easy_install doing an os.walk() and chmod'ing the files and/or directories
>> before the rmtree?
>
> I'll give it a try, just a minute...

Yes, that works -- see attached patch, verified to work on my XP SP2 
machine with native win32 SVN 1.2.3.


I'm still wondering why the advertised package dependency resolution 
doesn't seem to work for me, though -- multi-version or not (mechanize's 
dependencies ClientCookie, ClientForm and pullparser are not fetched):


C:\jjlee\code>easy_install -d . -m "mechanize==dev"
Searching for mechanize==dev
Reading http://www.python.org/pypi/mechanize/
Reading http://wwwsearch.sourceforge.net/mechanize/
Best match: mechanize dev
Downloading 
http://codespeak.net/svn/wwwsearch/mechanize/trunk#egg=mechanize-dev
Doing subversion checkout from 
http://codespeak.net/svn/wwwsearch/mechanize/trunk to 
c:\docume~1\johnle~1\locals~1\temp\
easy_install-6b1iw5\trunk
Processing trunk
Running setup.py -q bdist_egg --dist-dir 
c:\docume~1\johnle~1\locals~1\temp\easy_install-6b1iw5\trunk\egg-dist-tmp-q7jmh
m

Installed c:\jjlee\code\mechanize-0.0.10a-py2.4.egg

Because this distribution was installed --multi-version or --install-dir,
before you can import modules from this package in an application, you
will need to 'import pkg_resources' and then use a 'require()' call
similar to one of these examples, in order to select the desired version:

     pkg_resources.require("mechanize")  # latest installed version
     pkg_resources.require("mechanize==0.0.10a")  # this exact version
     pkg_resources.require("mechanize>=0.0.10a")  # this version or higher


C:\jjlee\code>easy_install "mechanize==dev"
Searching for mechanize==dev
Reading http://www.python.org/pypi/mechanize/
Reading http://wwwsearch.sourceforge.net/mechanize/
Best match: mechanize dev
Downloading 
http://codespeak.net/svn/wwwsearch/mechanize/trunk#egg=mechanize-dev
Doing subversion checkout from 
http://codespeak.net/svn/wwwsearch/mechanize/trunk to 
c:\docume~1\johnle~1\locals~1\temp\
easy_install-pxmwtr\trunk
Processing trunk
Running setup.py -q bdist_egg --dist-dir 
c:\docume~1\johnle~1\locals~1\temp\easy_install-pxmwtr\trunk\egg-dist-tmp-ad3px
3
Adding mechanize 0.0.10a to easy-install.pth file

Installed c:\python24\lib\site-packages\mechanize-0.0.10a-py2.4.egg

C:\jjlee\code>


John
-------------- next part --------------
--- c:\Python24\Lib\site-packages\setuptools-0.6a6-py2.4.egg\setuptools\command\easy_install.py~	Tue Nov 01 18:56:30 2005
+++ c:\Python24\Lib\site-packages\setuptools-0.6a6-py2.4.egg\setuptools\command\easy_install.py	Tue Nov 01 18:53:55 2005
@@ -10,7 +10,7 @@
 __ http://peak.telecommunity.com/DevCenter/EasyInstall
 """
 
-import sys, os.path, zipimport, shutil, tempfile, zipfile, re
+import sys, os.path, zipimport, shutil, tempfile, zipfile, re, stat
 from glob import glob
 from setuptools import Command
 from setuptools.sandbox import run_setup
@@ -318,6 +318,9 @@
 
         finally:
             if os.path.exists(tmpdir):
+                for dirpath, subdirs, fns in os.walk(tmpdir):
+                    for fn in fns:
+                        os.chmod(os.path.join(dirpath, fn), stat.S_IWRITE)
                 shutil.rmtree(tmpdir)
 
 


More information about the Distutils-SIG mailing list