XML RPC changes between 3.7 and 3.9 yield 401 http error

Chris Angelico rosuav at gmail.com
Wed Feb 24 13:22:29 EST 2021


On Thu, Feb 25, 2021 at 5:12 AM lucas <lucas at bourneuf.net> wrote:
>
> On 24/02/2021 18:48, Chris Angelico wrote:
> I added socket.gethostbyname("wiki.example.net") (i removed the https://
> since it, obviously now i think about it, led to a socket error)
> in the program, so i could verify both the URL and IP are equivalent.
>
> I got the exact same URL and IP. To be sure, i let python run the
> comparison instead of only relying on my eyes.
>
>  >>> 'https://wiki.example.net/lib/exe/xmlrpc.php?u=user&p=password' ==
> 'https://wiki.example.net/lib/exe/xmlrpc.php?u=user&p=password'
> True
>  >>> 'xx.xxx.xxx.197' == 'xx.xxx.xxx.197'
> True

Those URLs were printed out from each script, just before attempting the call?

> You gave me an idea: i checked the nginx log of the server hosting the
> dokuwiki instance, and got something of interest :
>
> [SERVER IP] - - [24/Feb/2021:19:08:31 +0100] "POST
> /lib/exe/xmlrpc.php?u=[USER]&p=[PASSWORD] HTTP/1.1" 200 209 "-"
> "Python-xmlrpc/3.7"
> [LAPTOP IP] - - [24/Feb/2021:19:08:35 +0100] "POST /lib/exe/xmlrpc.php
> HTTP/1.1" 401 433 "-" "Python-xmlrpc/3.9"
>
> It seems that the laptop is not sending the arguments, despite them
> being fed in the python code ?

Fascinating! Well, that does at least simplify things somewhat -
instead of "why is this coming back 401", it's "why is this not
sending credentials".

> Now i think about it, my remote server host both the python program into
> 3.7, and the dokuwiki. One may think it could be the source of the problem.
> To prove it's not, i will test with another laptop (the one under
> windows, python 3.7, which successfully accessed the wiki while i was
> discovering the error on my manjaro laptop) as soon as possible.
>

More data is always good.

ChrisA


More information about the Python-list mailing list