[zypp-devel] Python Bindings and RepoInfo.baseUrls()
I have the following example:
import zypp
def main():
myRepoInfo = zypp.RepoInfo()
myRepoInfo.addBaseUrl(zypp.Url("file:///mounts/mirror/SuSE/ftp.opensuse.org/srv/ftp/pub/opensuse/debug/update/11.1/"))
myRepoInfo.setAlias("default")
myRepoInfo.setName("default")
myRepoInfo.setEnabled(True)
myRepoInfo.setType(zypp.RepoType.RPMMD) # for now
myRepoInfo.setGpgCheck(False)
for url in myRepoInfo.baseUrls():
print url
if __name__ == "__main__":
main()
When I let it run I get the following error:
$ python baseurls.py
swig/python detected a memory leak of type 'std::set< zypp::Url,std::less
On Tue, Mar 10, Jan Blunck wrote:
I have the following example:
This is not related to the python part of the bindings. The same example in ruby is also broken. Basically the std::set stuff for the Url class seems to be odd. I'm neither able to append nor to insert new Url objects. Thankful for any hint, Jan
* Jan Blunck
On Tue, Mar 10, Jan Blunck wrote:
I have the following example:
This is not related to the python part of the bindings. The same example in ruby is also broken. Basically the std::set stuff for the Url class seems to be odd. I'm neither able to append nor to insert new Url objects.
This seems to be deep inside swig/libzypp/C++ and I have no idea how to fix this. Klaus -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
On Thu, Mar 12, Klaus Kaempf wrote:
* Jan Blunck
[Mar 11. 2009 15:55]: On Tue, Mar 10, Jan Blunck wrote:
I have the following example:
This is not related to the python part of the bindings. The same example in ruby is also broken. Basically the std::set stuff for the Url class seems to be odd. I'm neither able to append nor to insert new Url objects.
This seems to be deep inside swig/libzypp/C++ and I have no idea how to fix this.
I think I found the problem. It seems to be a namespace problem. Here is a
patch that fixes the issue. I also added a testcase for the RepoInfo class.
At the same time I extended the class by equivalents for dumpOn() and
friends. I'm usure if they are really necessary. At least the original methods
need to be ignored because of the std:ostream arguments.
Comments?
Jan
commit fca020d7476ac4e09e16895c7a16a64baa2caf48
Author: Jan Blunck
* Jan Blunck
On Thu, Mar 12, Klaus Kaempf wrote:
* Jan Blunck
[Mar 11. 2009 15:55]: On Tue, Mar 10, Jan Blunck wrote:
I have the following example:
This is not related to the python part of the bindings. The same example in ruby is also broken. Basically the std::set stuff for the Url class seems to be odd. I'm neither able to append nor to insert new Url objects.
This seems to be deep inside swig/libzypp/C++ and I have no idea how to fix this.
I think I found the problem. It seems to be a namespace problem. Here is a patch that fixes the issue. I also added a testcase for the RepoInfo class.
At the same time I extended the class by equivalents for dumpOn() and friends. I'm usure if they are really necessary. At least the original methods need to be ignored because of the std:ostream arguments.
Comments?
Great, thanks for your fix. Pushed to libzypp-bindings HEAD. Klaus -- To unsubscribe, e-mail: zypp-devel+unsubscribe@opensuse.org For additional commands, e-mail: zypp-devel+help@opensuse.org
participants (2)
-
Jan Blunck
-
Klaus Kaempf