emerge broken

Wolfgang Rohdewald wolfgang at rohdewald.de
Sat Jan 15 13:53:15 CET 2011


On Samstag 15 Januar 2011, Ralf Habacker wrote:
> Hi,
> 
> with latest emerge from svn I am not able to fetch
> kdewin-installer-static package
> 
> R:\build\win32libs-sources\dbus-src-1.4.1-20101222\work\msvc20
> 08-Debug-gitHEAD>emerge --fetch kdewin-installer-static
> emerge.bat executed
> 12:50
> emerge debug: buildAction: fetch
> emerge debug: packageName: kdewin-installer-static
> emerge debug: buildType: Debug
> emerge debug: buildTests: None
> ______________________________________________________________
> __________________ emerge warning: Import failed for file
> d:\daten\kde\emerge-msvc-root\emerge\portage\libs\qt-static\qt
> -static-4.5.2.py emerge warning: Import failed for file
> d:\daten\kde\emerge-msvc-root\emerge\portage\libs\qt-static\qt
> -static-4.5.2.py emerge warning: Import failed for file
> d:\daten\kde\emerge-msvc-root\emerge\portage\libs\qt-static\qt
> -static-4.5.2.py Traceback (most recent call last):
>    File
> "d:\daten\kde\emerge-msvc-root\emerge\portage\kdesupport\kdewi
> n-installer-static\kdewin-installer-static-0.9.8.py", line 37,
> in <module>
>      Package().execute()
>    File
> "d:\daten\kde\emerge-msvc-root\emerge\portage\kdesupport\kdewi
> n-installer-static\kdewin-installer-static-0.9.8.py", line 25,
> in __init__
>      self.qtstatic =
> portage.getPackageInstance('libs','qt-static') File
> "r:\emerge\bin\portage.py", line 441, in getPackageInstance
> return PortageInstance.getPackageInstance(category, package,
> buildtarget)
>    File "r:\emerge\bin\portage.py", line 267, in
> getPackageInstance p = module.Package()
> AttributeError: 'NoneType' object has no attribute 'Package'
> emerge fatal error: running python
> d:\daten\kde\emerge-msvc-root\emerge\portage\kdesupport\kdewin
> -installer-static\kdewin-installer-static-0.9.8.py fetch
> 12:50
> 
> Any idea how to solve this problem ?
 
does not happen here.

the line above the bug is

module = __import__(filename)

__import__ should never return NoneType, it should either 
return a module or raise an exception. 

what is the value for filename for you?

> @wolfgang: the first series of patches are more cosmetic, 
> recent patches changes bahavior of emerge like this error -

if this really is new behaviour - I am not yet convinced.

but I just found a bug in Object.__import__: If imp.load_module
fails, the file fileHdl remains open. The python doc says about
load_module:

> Important: the caller is responsible for closing the file
> argument, if it was not None, even when an exception is raised.
> This is best done using a try ... finally statement.

with Python 2.7 this is easy to do with a context manager:

with open(module) as fileHdl:

actually it might be a good idea to do that for all open()
to prevent file handle leaks and make the code simpler.


> having read access to the outstanding patches makes is
> possible to see problems before they breaks someones work.

maybe I should reorder the patches, apply trivial patches
directly and publish the rest in the reviewboard.

would that be OK for you?

-- 
Wolfgang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-windows/attachments/20110115/9a3592c4/attachment.htm 


More information about the Kde-windows mailing list