#906161 python-debianbts: get_bugs doesn't marshal usertags properly

#906161#5
Date:
2018-08-15 07:57:42 UTC
From:
To:
Hi,

marshaling for get_bugs' "usertags" param doesn't seem to work properly.
There's some special casing with _build_int_array_el for lists and
tuples but not for dicts.  The below seems to make it work.

Cheers,
Julien

diff --git a/debianbts/debianbts.py b/debianbts/debianbts.py
index d638e26..8816b7a 100644
--- a/debianbts/debianbts.py
+++ b/debianbts/debianbts.py
@@ -405,6 +405,13 @@ def get_bugs(*key_value):
         arg_name = 'arg' + str(arg_n)
         if isinstance(kv, (list, tuple)):
             _build_int_array_el(arg_name, method_el, kv)
+        elif isinstance(kv, dict):
+            el = method_el.add_child(arg_name)
+            for k, v in kv.items():
+                if isinstance(v, (list, tuple)):
+                    _build_int_array_el(k, el, v)
+                else:
+                    el.marshall(k, v)
         else:
             method_el.marshall(arg_name, kv)

#906161#10
Date:
2018-09-29 21:54:21 UTC
From:
To:
Hi Julien,

can you please provide a call to reproduce the error? According to the
docs, the get_bugs has no `usertags` parameter:

https://wiki.debian.org/DebbugsSoapInterface


Cheers,

Bastian

#906161#15
Date:
2020-12-18 11:23:22 UTC
From:
To:
Didn't receive an answer from the reporter to reproduce the bug for 2
years, closing the bug.

#906161#20
Date:
2020-12-19 09:12:22 UTC
From:
To:
Control: reopen -1
You never contacted the reporter, so it shouldn't be surprising you
didn't get an answer.

Cheers,
Julien

#906161#27
Date:
2020-12-19 10:57:41 UTC
From:
To:
I think it must have been something like this:

ut = debianbts.get_usertag('release.debian.org@packages.debian.org')
debianbts.get_bugs(package='release.debian.org', tag=['pu', 'buster'],
                   usertags=ut)

https://salsa.debian.org/debbugs-team/debbugs/-/blob/master/lib/Debbugs/Bugs.pm#L117
describes the usertags param for get_bugs.

I get:

SoapFault: soap:Client: Application failed during request deserialization:
not well-formed (invalid token) at line 5, column 304, byte 544 at /usr/lib/x86_64-linux-gnu/perl5/5.28/XML/Parser/Expat.pm line 487.
	XML::Parser::Expat::parse(XML::Parser::Expat=HASH(0x55d36e3b48e8), "<?xml version=\"1.0\" encoding=\"UTF-8\"?><soap:Envelope xmlns:xs"...) called at /usr/lib/x86_64-linux-gnu/perl5/5.28/XML/Parser.pm line 187
	eval {...} called at /usr/lib/x86_64-linux-gnu/perl5/5.28/XML/Parser.pm line 186
	XML::Parser::parse(XML::Parser=HASH(0x55d36e2d6d50), "<?xml version=\"1.0\" encoding=\"UTF-8\"?><soap:Envelope xmlns:xs"...) called at /usr/share/perl5/SOAP/Lite.pm line 1788
	eval {...} called at /usr/share/perl5/SOAP/Lite.pm line 1787
	SOAP::Parser::decode(SOAP::Parser=HASH(0x55d36cc1fc48), "<?xml version=\"1.0\" encoding=\"UTF-8\"?><soap:Envelope xmlns:xs"...) called at /usr/share/perl5/SOAP/Lite.pm line 2153
	SOAP::Deserializer::decode(SOAP::Deserializer=HASH(0x55d36cc20020), "<?xml version=\"1.0\" encoding=\"UTF-8\"?><soap:Envelope xmlns:xs"...) called at /usr/share/perl5/SOAP/Lite.pm line 2170
	SOAP::Deserializer::deserialize(SOAP::Deserializer=HASH(0x55d36cc20020), "<?xml version=\"1.0\" encoding=\"UTF-8\"?><soap:Envelope xmlns:xs"...) called at /usr/share/perl5/SOAP/Lite.pm line 2848
	eval {...} called at /usr/share/perl5/SOAP/Lite.pm line 2848
	eval {...} called at /usr/share/perl5/SOAP/Lite.pm line 2844
	SOAP::Server::handle(Debbugs::SOAP::Server=HASH(0x55d36cc03e70), "<?xml version=\"1.0\" encoding=\"UTF-8\"?><soap:Envelope xmlns:xs"...) called at /usr/share/perl5/SOAP/Transport/HTTP.pm line 459
	SOAP::Transport::HTTP::Server::handle(Debbugs::SOAP::Server=HASH(0x55d36cc03e70)) called at /usr/share/perl5/SOAP/Transport/HTTP.pm line 627
	SOAP::Transport::HTTP::CGI::handle(Debbugs::SOAP::Server=HASH(0x55d36cc03e70)) called at /srv/bugs.debian.org/cgi-bin/soap.cgi line 44
	eval {...} called at /srv/bugs.debian.org/cgi-bin/soap.cgi line 40

My patch from 2 years ago is probably wrong as I can't seem to get it to work
now.

Interestingly this seems to work though, even without the patch:

debianbts.get_bugs(package='release.debian.org',
                   tag=['pu', 'buster'],
                   usertags={'pu': ut['pu']}))

So maybe I got this wrong back then and the cause is something entirely
different...

Cheers,
Julien

#906161#32
Date:
2020-12-19 21:01:04 UTC
From:
To:
Hi Julien,

thanks for the reply. Regarding your original bugreport, the usertags
parameter seems not to be documented in the wiki:
https://wiki.debian.org/DebbugsSoapInterface

Since it seems to work anyways for you, do you mind closing the
bugreport now? I was closing it, because I didn't receive an answer from
you for two years.


Cheers,

Bastian




Am 19.12.20 um 11:57 schrieb Julien Cristau:

#906161#37
Date:
2021-01-27 13:41:19 UTC
From:
To:
I'm not sure I'd consider the wiki as a reference though?  Clearly it's
incomplete.
Well it doesn't seem to work quite right, and the reason you didn't
receive an answer is you didn't ask me anything.

Cheers,
Julien