[Osgeo4w-trac] Re: [osgeo4w] #251: apt fails upgrading or removing python package

OSGeo4W trac_osgeo4w at osgeo.org
Fri Jan 20 13:06:50 EST 2012


#251: apt fails upgrading or removing python package
-------------------+--------------------------------------------------------
Reporter:  maphew  |       Owner:  maphew 
    Type:  defect  |      Status:  new    
Priority:  major   |   Component:  Package
 Version:          |    Keywords:  pkg-apt
-------------------+--------------------------------------------------------

Old description:

> The standalone apt.exe loads the python dll located in the same directory
> as itself even though it has the dll packaged internally. Consequently
> the in-use file cannot be deleted and replaced.
>
> Workaround: copy apt.exe to a different location and run from there.
>
> {{{
> C:\>which apt
> B:\o4w\bin\apt.EXE
>
> C:\>apt remove python
> removing python 2.7.2-2
> removed: B:\o4w\apps\Python27\tcl\tcl8.5\package.tcl
> ...
> removed: B:\o4w\bin\python.exe
> removed: B:\o4w\bin\w9xpopen.exe
> removed: B:\o4w\bin\pythonw.exe
> Traceback (most recent call last):
>   File "<string>", line 1043, in <module>
>   File "<string>", line 238, in remove
>   File "<string>", line 453, in do_uninstall
> WindowsError: [Error 5] Access is denied: 'B:\\o4w\\bin\\python27.dll'
>
> C:\>copy b:\o4w\bin\apt.exe D:\
>
> C:\>D:\apt.exe remove python
> removing python 2.7.2-2
> warning: B:\o4w\apps\Python27\tcl\tcl8.5\package.tcl no such file
> ...
> warning: B:\o4w\bin\python.exe no such file
> warning: B:\o4w\bin\w9xpopen.exe no such file
> warning: B:\o4w\bin\pythonw.exe no such file
> removed: B:\o4w\bin\python27.dll
> removed: B:\o4w\etc\ini\python.bat
> }}}

New description:

 The standalone apt.exe loads the python dll located in the same directory
 as itself even though it has the dll packaged internally. Consequently the
 in-use file cannot be deleted and replaced.

 Workaround: copy apt.exe to a different location and run from there.

 '''Error:'''
 {{{
 C:\>which apt
 B:\o4w\bin\apt.EXE

 C:\>apt remove python
 removing python 2.7.2-2
 removed: B:\o4w\apps\Python27\tcl\tcl8.5\package.tcl
 ...
 removed: B:\o4w\bin\python.exe
 removed: B:\o4w\bin\w9xpopen.exe
 removed: B:\o4w\bin\pythonw.exe
 Traceback (most recent call last):
   File "<string>", line 1043, in <module>
   File "<string>", line 238, in remove
   File "<string>", line 453, in do_uninstall
 WindowsError: [Error 5] Access is denied: 'B:\\o4w\\bin\\python27.dll'
 }}}

 '''Workaround:'''
 {{{
 C:\>copy b:\o4w\bin\apt.exe D:\

 C:\>D:\apt.exe remove python
 removing python 2.7.2-2
 warning: B:\o4w\apps\Python27\tcl\tcl8.5\package.tcl no such file
 ...
 removed: B:\o4w\bin\python27.dll
 removed: B:\o4w\etc\ini\python.bat
 }}}

--

Comment(by maphew):

 Possible solutions:

 a) Always run apt.exe from %temp%. All this would take is changing apt.bat
 a little. Drawback is never knowing when %temp% will get cleaned out. If
 frequent, apt's startup time will be lengthier as the .exe get's recopied
 before loading.

 b) Repackage apt.exe install location from .\bin to .\apps\apt.

 c) talk to pyInstaller folks and see if there is a flag or something to
 force the .exe to use the internal .dll no matter what.

-- 
Ticket URL: <http://trac.osgeo.org/osgeo4w/ticket/251#comment:1>
OSGeo4W <http://trac.osgeo.org/osgeo4w>
OSGeo4W is the Windows installer and package environment for the OSGeo stack.


More information about the Osgeo4w-trac mailing list