#87 pywin32_postinstall.py fails when installing an egg

open
nobody
None
5
2008-09-04
2008-09-04
Hartmut Goebel
No

pywin32_postinstall.py fails when installing an egg.

I figured out that LoadSystemModule wants to load
C:\Python25\Lib\site-packages\pywin32_system32\pywintypes25.dll
which doe not exist in an egg.

Enclosed patch used pkg_resources to get the correct directory.

Discussion

  • Hartmut Goebel
    Hartmut Goebel
    2008-09-04

    pywin32-egg.patch

     
    Attachments
  • Mark Hammond
    Mark Hammond
    2009-02-07

    Sorry for the delay in getting to this. I don't think the patch is quite correct - eg, on my machine without a pywin32 egg installed:

    python -c "from pkg_resources import resource_filename, Requirement;print resource_filename(Requirement.parse('pywin32'), '')"
    ...
    File "o:\src\python-2.5-svn\lib\ntpath.py", line 90, in join
    assert len(path) > 0
    TypeError: object of type 'NoneType' has no len()

    So we probably need a way to reliably detect if we are being installed from an egg or not.

    Secondly, I'm a little concerned about running the post-install script automatically. I imagine that many users of pywin32 via an egg will be using some kind of 'automated' process, possibly in a virtualenv environment, or stand-alone Zope environment etc. In such cases it doesn't make sense to perform most of those post-install tasks - even copying those DLLs to system32 would be inappropriate - in such cases they should *only* be installed to the python dir and never to system32. Maybe the post-install script needs to change its behaviour based on being in an egg or not - which ties in with my initial comment. Any thoughts?