[issue461966] Adds an XML-RPC server module

2022-04-10 Thread admin


Change by admin :


--
github: None -> 35179

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28968] xml rpc server fails with connection reset by peer error no 104

2021-04-26 Thread Irit Katriel


Irit Katriel  added the comment:

2.7 is no longer maintained. Please create a new issue with full reproduction 
information if you are still having this problem in 3.8+.

--
nosy: +iritkatriel
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-03-29 Thread Dieter Maurer
lucas wrote at 2021-3-27 18:53 +0100:
>Following our previous discussion:
> https://www.talkend.net/post/287193.html
>
>I finally took time (thanks to Florian R.) to get a reproducible example
>of my problem, as asked previously by ChrisA.

I compared `xmlrpc.client.ServerProxy.__init__`
for Python 3.6 and Python 3.9(a5):
Python 3.6 uses `splittype` and `splithost` to parse *uri*
while Python 3.9 uses `urlparse` to complete decompose *uri*
and then uses `scheme`, `netloc` and `path` from the result.
As a consequence Python 3.9 misses any information in the "query string".

In my view, Python 3.6 behaves as documented (in the `ServerProxy` "docstring")
while Python 3.9 does not. At your place, I would file a bug
report at "https://bugs.python.org/;.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-03-28 Thread Terry Reedy

On 3/27/2021 6:10 PM, lucas wrote:


I hope it will solve it too. Do i need to do anything ?


Review the patch by trying it out on your system.  If necessary because 
you do not have a local cpython clone, backup installed 3.9 
Lib/xmlrpc.py and hand-edit. Then report OS, python used, and result. 
(If it works, you can keep the patched version ;-).


For many issues, reviews are the bottleneck for getting fixes released.

--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-03-28 Thread Chris Angelico
On Sun, Mar 28, 2021 at 9:12 AM lucas  wrote:
>
> Thank you ChrisA !
>
> I hope it will solve it too. Do i need to do anything ?
>
> Thank you for your time and help.
>

There are a couple of things you can do actually! First off, here's
the pull request, which will be where further comments happen:

https://github.com/python/cpython/pull/25045

Since you actually use xmlrpc, you'd be the best person to devise some
useful tests. Also, the question has been raised regarding the
fragment. I suspect that a fragment is inappropriate here, since it's
effectively an external URL, but that's for you to answer; if
fragments are to be stripped, that definitely needs to be mentioned.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-03-27 Thread Terry Reedy

On 3/27/2021 5:49 PM, Chris Angelico wrote:


https://bugs.python.org/issue38038

It seems to have been intended as a pure refactor, so I'd call this a
regression. Fortunately, it's not difficult to fix; but I'm not sure
if there are any other subtle changes.

The regression's already been reported so I'm adding to this issue:

https://bugs.python.org/issue43433


You added a PR, which is great, but useless unless a currently active 
coredev reviews and merges.  I requested such from the author and merger 
of the apparently offending commit.


--
Terry Jan Reedy

--
https://mail.python.org/mailman/listinfo/python-list


Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-03-27 Thread lucas

Thank you ChrisA !

I hope it will solve it too. Do i need to do anything ?

Thank you for your time and help.

Best wishes,
--lucas



On 27/03/2021 22:49, Chris Angelico wrote:

On Sun, Mar 28, 2021 at 5:00 AM lucas  wrote:

I finally took time (thanks to Florian R.) to get a reproducible example
of my problem, as asked previously by ChrisA.


Thanks! With this in hand, I can play around with it.


On debian, Python 3.7, i got:

  127.0.0.1 - - [27/Mar/2021 18:31:13] "POST /?u=user=password
HTTP/1.1" 404 -

On Arch, python 3.9, i got:

   aluriak@arch❯ python3.9 p.py server
  127.0.0.1 - - [27/Mar/2021 18:35:45] "POST /RPC2 HTTP/1.1" 200 -


On Debian, with both versions having been built from source, the same
occurs. Furthermore, Python 3.8 behaves as 3.7 does. This definitely
changed in 3.9.


Note that the two outputs differs in two ways:

  127.0.0.1 - - [27/Mar/2021 18:31:13] "POST /?u=user=password
HTTP/1.1" 404 -
  127.0.0.1 - - [27/Mar/2021 18:35:45] "POST /RPC2 HTTP/1.1" 200 -

The first contains the arguments, and the second contains the path.
Sounds like there is something wrong with both modules.


One point of note is that the request as given actually doesn't have a
slash. I think that's technically wrong, but a lot of systems will
just implicitly add the slash. That, coupled with commit 9c4c45, is
why you're seeing "/RPC2" in there. That distinction vanishes if you
change your client thusly:

url = 'http://' + URL + '/?' + urlencode({'u': USER, 'p': PASSWD})

Actually, it looks like all the changes came in with that commit. The
old way used some internal functions from urllib.parse, and the new
way uses the public function urllib.parse.urlparse(), and there are
some subtle differences. For one thing, the old way would implicitly
readd the missing slash, thus hiding the above issue; the new way
leaves the path empty (thus triggering the "/RPC2" replacement). But
perhaps more significantly, the old way left query parameters in the
"path" portion, where the new way has a separate "query" portion that
is being lost. Here's the relevant BPO:

https://bugs.python.org/issue38038

It seems to have been intended as a pure refactor, so I'd call this a
regression. Fortunately, it's not difficult to fix; but I'm not sure
if there are any other subtle changes.

The regression's already been reported so I'm adding to this issue:

https://bugs.python.org/issue43433

Hopefully that solves the problem!

ChrisA


--
https://mail.python.org/mailman/listinfo/python-list


Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-03-27 Thread Chris Angelico
On Sun, Mar 28, 2021 at 5:00 AM lucas  wrote:
> I finally took time (thanks to Florian R.) to get a reproducible example
> of my problem, as asked previously by ChrisA.

Thanks! With this in hand, I can play around with it.

> On debian, Python 3.7, i got:
>
>  127.0.0.1 - - [27/Mar/2021 18:31:13] "POST /?u=user=password
> HTTP/1.1" 404 -
>
> On Arch, python 3.9, i got:
>
>   aluriak@arch❯ python3.9 p.py server
>  127.0.0.1 - - [27/Mar/2021 18:35:45] "POST /RPC2 HTTP/1.1" 200 -

On Debian, with both versions having been built from source, the same
occurs. Furthermore, Python 3.8 behaves as 3.7 does. This definitely
changed in 3.9.

> Note that the two outputs differs in two ways:
>
>  127.0.0.1 - - [27/Mar/2021 18:31:13] "POST /?u=user=password
> HTTP/1.1" 404 -
>  127.0.0.1 - - [27/Mar/2021 18:35:45] "POST /RPC2 HTTP/1.1" 200 -
>
> The first contains the arguments, and the second contains the path.
> Sounds like there is something wrong with both modules.

One point of note is that the request as given actually doesn't have a
slash. I think that's technically wrong, but a lot of systems will
just implicitly add the slash. That, coupled with commit 9c4c45, is
why you're seeing "/RPC2" in there. That distinction vanishes if you
change your client thusly:

url = 'http://' + URL + '/?' + urlencode({'u': USER, 'p': PASSWD})

Actually, it looks like all the changes came in with that commit. The
old way used some internal functions from urllib.parse, and the new
way uses the public function urllib.parse.urlparse(), and there are
some subtle differences. For one thing, the old way would implicitly
readd the missing slash, thus hiding the above issue; the new way
leaves the path empty (thus triggering the "/RPC2" replacement). But
perhaps more significantly, the old way left query parameters in the
"path" portion, where the new way has a separate "query" portion that
is being lost. Here's the relevant BPO:

https://bugs.python.org/issue38038

It seems to have been intended as a pure refactor, so I'd call this a
regression. Fortunately, it's not difficult to fix; but I'm not sure
if there are any other subtle changes.

The regression's already been reported so I'm adding to this issue:

https://bugs.python.org/issue43433

Hopefully that solves the problem!

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-03-27 Thread lucas
And, in my outputs, a key part is missing: the received arguments as 
parsed by Flask:


Python 3.7:
REQUEST: ImmutableMultiDict([('u', 'user'), ('p', 'password')])

Python 3.9:
REQUEST: ImmutableMultiDict([])


Have a good day everyone,
--lucas


On 27/03/2021 18:53, lucas wrote:

Following our previous discussion:
     https://www.talkend.net/post/287193.html

I finally took time (thanks to Florian R.) to get a reproducible example 
of my problem, as asked previously by ChrisA.


The following code is implementing a webserver with Flask, and a client 
with the XMLRPC client:


     import sys
     from xmlrpc import server, client
     from urllib.parse import urlencode
     from flask import Flask, request


     PORT = 23456
     USER, PASSWD = 'user', 'password'
     URL = '127.0.0.1:' + str(PORT)

     if len(sys.argv) > 1 and sys.argv[1] == 'server':
     app = Flask(__name__)
     @app.route('/', methods=['POST'])
     @app.route('/RPC2', methods=['POST'])
     def login():
     print('REQUEST:', request.args)
     return 'ok'
     app.run(debug=True, host='localhost', port=PORT)

     else:
     url = 'http://' + URL + '?' + urlencode({'u': USER, 'p': PASSWD})
     print(url)
     proxy = client.ServerProxy(url)
     print(proxy, dir(proxy))
     print(proxy.add(2, 3))


You can run the client with `python3 p.py`, and the server with `python3 
p.py server`.


On debian, Python 3.7, i got:

     lucas@debianserver:~$ python3.7 p.py server
  * Serving Flask app "p" (lazy loading)
  * Environment: production
    WARNING: This is a development server. Do not use it in a 
production deployment.

    Use a production WSGI server instead.
  * Debug mode: on
  * Running on http://localhost:23456/ (Press CTRL+C to quit)
  * Restarting with stat
  * Debugger is active!
  * Debugger PIN: 249-992-288
     127.0.0.1 - - [27/Mar/2021 18:31:13] "POST /?u=user=password 
HTTP/1.1" 404 -



On Arch, python 3.9, i got:

  aluriak@arch❯ python3.9 p.py server
  * Serving Flask app "p" (lazy loading)
  * Environment: production
    WARNING: This is a development server. Do not use it in a 
production deployment.

    Use a production WSGI server instead.
  * Debug mode: on
  * Running on http://localhost:23456/ (Press CTRL+C to quit)
  * Restarting with stat
  * Debugger is active!
  * Debugger PIN: 821-276-100
     127.0.0.1 - - [27/Mar/2021 18:35:45] "POST /RPC2 HTTP/1.1" 200 -


Both systems return the same output on command `pip3 freeze | grep 
Flask`, which is `Flask==1.1.2`.



Note that the two outputs differs in two ways:

     127.0.0.1 - - [27/Mar/2021 18:31:13] "POST /?u=user=password 
HTTP/1.1" 404 -

     127.0.0.1 - - [27/Mar/2021 18:35:45] "POST /RPC2 HTTP/1.1" 200 -

The first contains the arguments, and the second contains the path. 
Sounds like there is something wrong with both modules.


This should be a reproducible example ; plus i'm not the only one to 
encounter that problem:
 
https://github.com/kynan/dokuwikixmlrpc/issues/8#issuecomment-808755244


Best regards,
--lucas

--
https://mail.python.org/mailman/listinfo/python-list


Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-03-27 Thread lucas

Following our previous discussion:
https://www.talkend.net/post/287193.html

I finally took time (thanks to Florian R.) to get a reproducible example 
of my problem, as asked previously by ChrisA.


The following code is implementing a webserver with Flask, and a client 
with the XMLRPC client:


import sys
from xmlrpc import server, client
from urllib.parse import urlencode
from flask import Flask, request


PORT = 23456
USER, PASSWD = 'user', 'password'
URL = '127.0.0.1:' + str(PORT)

if len(sys.argv) > 1 and sys.argv[1] == 'server':
app = Flask(__name__)
@app.route('/', methods=['POST'])
@app.route('/RPC2', methods=['POST'])
def login():
print('REQUEST:', request.args)
return 'ok'
app.run(debug=True, host='localhost', port=PORT)

else:
url = 'http://' + URL + '?' + urlencode({'u': USER, 'p': PASSWD})
print(url)
proxy = client.ServerProxy(url)
print(proxy, dir(proxy))
print(proxy.add(2, 3))


You can run the client with `python3 p.py`, and the server with `python3 
p.py server`.


On debian, Python 3.7, i got:

lucas@debianserver:~$ python3.7 p.py server
 * Serving Flask app "p" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a 
production deployment.

   Use a production WSGI server instead.
 * Debug mode: on
 * Running on http://localhost:23456/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 249-992-288
127.0.0.1 - - [27/Mar/2021 18:31:13] "POST /?u=user=password 
HTTP/1.1" 404 -



On Arch, python 3.9, i got:

 aluriak@arch❯ python3.9 p.py server
 * Serving Flask app "p" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a 
production deployment.

   Use a production WSGI server instead.
 * Debug mode: on
 * Running on http://localhost:23456/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 821-276-100
127.0.0.1 - - [27/Mar/2021 18:35:45] "POST /RPC2 HTTP/1.1" 200 -


Both systems return the same output on command `pip3 freeze | grep 
Flask`, which is `Flask==1.1.2`.



Note that the two outputs differs in two ways:

127.0.0.1 - - [27/Mar/2021 18:31:13] "POST /?u=user=password 
HTTP/1.1" 404 -

127.0.0.1 - - [27/Mar/2021 18:35:45] "POST /RPC2 HTTP/1.1" 200 -

The first contains the arguments, and the second contains the path. 
Sounds like there is something wrong with both modules.


This should be a reproducible example ; plus i'm not the only one to 
encounter that problem:

https://github.com/kynan/dokuwikixmlrpc/issues/8#issuecomment-808755244

Best regards,
--lucas
--
https://mail.python.org/mailman/listinfo/python-list


Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-02-24 Thread lucas

On 24/02/2021 20:21, Chris Angelico wrote:

On Thu, Feb 25, 2021 at 6:14 AM lucas  wrote:

I tested from the windows computer (Python 3.8, it appears, not 3.7 as i
thought), and got the following nginx log:

[LAPTOP IP] - - [24/Feb/2021:20:06:42 +0100] "POST
/lib/exe/xmlrpc.php?u=[user]=[password] HTTP/1.1" 200 209 "-"
"DokuWikiXMLRPC  1.0  for testing windows"

That other laptop also had an ubuntu installed, with python 3.6.9, so i
ran the program and got the expected output, and the following nginx log:
[LAPTOP IP] - - [24/Feb/2021:20:04:04 +0100] "POST
/lib/exe/xmlrpc.php?u=[user]=[password] HTTP/1.1" 200 209 "-"
"DokuWikiXMLRPC  1.0  for testing ubuntu"

Both accessed correctly the dokuwiki version. Unless this is a platform
specific problem, it seems to narrow it to 3.9.



Curious.

I think, at this point, we need a repeatable test case. Wonder how
hard it would be to make a single Python script that has a tiny server
and a tiny client, and tries to connect them.

ChrisA


I will work on that tomorrow.

Thanks for your guidance, i will come back with a repeatable test case.

Best regards,
--lucas
--
https://mail.python.org/mailman/listinfo/python-list


Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-02-24 Thread Chris Angelico
On Thu, Feb 25, 2021 at 6:14 AM lucas  wrote:
> I tested from the windows computer (Python 3.8, it appears, not 3.7 as i
> thought), and got the following nginx log:
>
> [LAPTOP IP] - - [24/Feb/2021:20:06:42 +0100] "POST
> /lib/exe/xmlrpc.php?u=[user]=[password] HTTP/1.1" 200 209 "-"
> "DokuWikiXMLRPC  1.0  for testing windows"
>
> That other laptop also had an ubuntu installed, with python 3.6.9, so i
> ran the program and got the expected output, and the following nginx log:
> [LAPTOP IP] - - [24/Feb/2021:20:04:04 +0100] "POST
> /lib/exe/xmlrpc.php?u=[user]=[password] HTTP/1.1" 200 209 "-"
> "DokuWikiXMLRPC  1.0  for testing ubuntu"
>
> Both accessed correctly the dokuwiki version. Unless this is a platform
> specific problem, it seems to narrow it to 3.9.
>

Curious.

I think, at this point, we need a repeatable test case. Wonder how
hard it would be to make a single Python script that has a tiny server
and a tiny client, and tries to connect them.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-02-24 Thread lucas

On 24/02/2021 19:22, Chris Angelico wrote:

On Thu, Feb 25, 2021 at 5:12 AM lucas  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=password' ==
'https://wiki.example.net/lib/exe/xmlrpc.php?u=user=password'
True
  >>> 'xx.xxx.xxx.197' == 'xx.xxx.xxx.197'
True


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


Yes. The program is that one :

import socket
import xmlrpc.client as xmlrpclib
from xml.parsers.expat import ExpatError
from urllib.parse import urlencode

URL = 'https://wiki.example.net'
USER_AGENT = 'DokuWikiXMLRPC  1.0  for testing'

script = '/lib/exe/xmlrpc.php'
url = URL + script + '?' + urlencode({'u': USER, 'p': PASSWD})
print(url)
print(socket.gethostbyname('wiki.example.net'))
# xmlrpclib.Transport.user_agent = USER_AGENT
# xmlrpclib.SafeTransport.user_agent = USER_AGENT

proxy = xmlrpclib.ServerProxy(url)
v = proxy.dokuwiki.getVersion()
print(v)





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]=[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".


Yes, we are going forward :)






More data is always good.

ChrisA


I tested from the windows computer (Python 3.8, it appears, not 3.7 as i 
thought), and got the following nginx log:


[LAPTOP IP] - - [24/Feb/2021:20:06:42 +0100] "POST 
/lib/exe/xmlrpc.php?u=[user]=[password] HTTP/1.1" 200 209 "-" 
"DokuWikiXMLRPC  1.0  for testing windows"


That other laptop also had an ubuntu installed, with python 3.6.9, so i 
ran the program and got the expected output, and the following nginx log:
[LAPTOP IP] - - [24/Feb/2021:20:04:04 +0100] "POST 
/lib/exe/xmlrpc.php?u=[user]=[password] HTTP/1.1" 200 209 "-" 
"DokuWikiXMLRPC  1.0  for testing ubuntu"


Both accessed correctly the dokuwiki version. Unless this is a platform 
specific problem, it seems to narrow it to 3.9.


--lucas
--
https://mail.python.org/mailman/listinfo/python-list


Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-02-24 Thread Chris Angelico
On Thu, Feb 25, 2021 at 5:12 AM lucas  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=password' ==
> 'https://wiki.example.net/lib/exe/xmlrpc.php?u=user=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]=[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
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-02-24 Thread lucas

On 24/02/2021 18:48, Chris Angelico wrote:

On Thu, Feb 25, 2021 at 4:36 AM lucas  wrote:

A properly-formed URL will start with a protocol. I don't know
specifically what changed, but it's looking like something started
rejecting malformed URLs. Try adding "http://; or "https://; to your
URL (whichever is appropriate) and see if both versions will accept
it.

ChrisA



I did that, obtaining the following URL

https://wiki.[…]/lib/exe/xmlrpc.php?u=[…]=[…]

on my two currently available computer (laptop on 3.9, remote on 3.7),
and the results is the same.

For information, i'm uploading the same python program to my remote
server (debian, 3.7), and running it with the same parameters as my
laptop (manjaro, 3.9). My laptop is getting the 401, my server is
getting the expected dokuwiki version.


(I'm aware that you have some other actual domain, but I'll continue
using "wiki.example.net" as per your original post.)

Is it possible that there's some kind of server-based restriction?
What happens if you call socket.gethostbyname("wiki.example.net") on
both the laptop and the server - do you get back the same IP address?
(Or use gethostbyname_ex, or possibly getaddrinfo if ipv6 support
matters.)

Also, just to make sure there's nothing stupid happening, try printing
out the URL on both machines. Obviously censor the password before
sharing it here, but mainly, make sure that the two are generating the
exact same URL, just in case. Both are running 3.7+, so dict iteration
order shouldn't be getting in your way, but I've seen crazier things
before :)

ChrisA



Thanks for taking time to help me !

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=password' == 
'https://wiki.example.net/lib/exe/xmlrpc.php?u=user=password'

True
>>> 'xx.xxx.xxx.197' == 'xx.xxx.xxx.197'
True

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]=[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 ?



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.


--lucas
--
https://mail.python.org/mailman/listinfo/python-list


Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-02-24 Thread Chris Angelico
On Thu, Feb 25, 2021 at 4:36 AM lucas  wrote:
> > A properly-formed URL will start with a protocol. I don't know
> > specifically what changed, but it's looking like something started
> > rejecting malformed URLs. Try adding "http://; or "https://; to your
> > URL (whichever is appropriate) and see if both versions will accept
> > it.
> >
> > ChrisA
> >
>
> I did that, obtaining the following URL
>
> https://wiki.[…]/lib/exe/xmlrpc.php?u=[…]=[…]
>
> on my two currently available computer (laptop on 3.9, remote on 3.7),
> and the results is the same.
>
> For information, i'm uploading the same python program to my remote
> server (debian, 3.7), and running it with the same parameters as my
> laptop (manjaro, 3.9). My laptop is getting the 401, my server is
> getting the expected dokuwiki version.

(I'm aware that you have some other actual domain, but I'll continue
using "wiki.example.net" as per your original post.)

Is it possible that there's some kind of server-based restriction?
What happens if you call socket.gethostbyname("wiki.example.net") on
both the laptop and the server - do you get back the same IP address?
(Or use gethostbyname_ex, or possibly getaddrinfo if ipv6 support
matters.)

Also, just to make sure there's nothing stupid happening, try printing
out the URL on both machines. Obviously censor the password before
sharing it here, but mainly, make sure that the two are generating the
exact same URL, just in case. Both are running 3.7+, so dict iteration
order shouldn't be getting in your way, but I've seen crazier things
before :)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-02-24 Thread lucas

On 24/02/2021 18:00, Chris Angelico wrote:

On Thu, Feb 25, 2021 at 2:02 AM lucas  wrote:


Hi everyone,

(Sorry for the double-send if any, i'm not sure the first send was
performed, maybe because of bounce errors according to mailman.)


I'm currently trying to understand an error when using the
dokuwikixmlrpc python module, allowing to easily work with DokuWiki RPC
interface.

Another description of the problem :
 https://github.com/kynan/dokuwikixmlrpc/issues/8

Here is the code, tailored to work with the DokuWiki RPC interface:

  from urllib.parse import urlencode
  import xmlrpc.client as xmlrpclib

  URL = 'wiki.example.net'
  USER = 'user'
  PASSWD = 'password'
  USER_AGENT = 'DokuWikiXMLRPC  1.0  for testing'

  script = '/lib/exe/xmlrpc.php'
  url = URL + script + '?' + urlencode({'u': USER, 'p': PASSWD})
  xmlrpclib.Transport.user_agent = USER_AGENT
  xmlrpclib.SafeTransport.user_agent = USER_AGENT
  proxy = xmlrpclib.ServerProxy(url)

  v = proxy.dokuwiki.getVersion()
  print(v)

When ran with Python 3.7 (a personnal debian server, or a personal
windows computer), i obtain the expected 'Release 2018-04-22a "Greebo"'
as ouput.
When ran with Python 3.9 (my personnal, manjaro machine), i obtain the
following stacktrace:

  Traceback (most recent call last):
File "/home/project/read.py", line 32, in 
  v = proxy.dokuwiki.getVersion()
File "/usr/lib/python3.9/xmlrpc/client.py", line 1116, in __call__
  return self.__send(self.__name, args)
File "/usr/lib/python3.9/xmlrpc/client.py", line 1456, in __request
  response = self.__transport.request(
File "/usr/lib/python3.9/xmlrpc/client.py", line 1160, in request
  return self.single_request(host, handler, request_body, verbose)
File "/usr/lib/python3.9/xmlrpc/client.py", line 1190, in
single_request
  raise ProtocolError(
  xmlrpc.client.ProtocolError: 



A properly-formed URL will start with a protocol. I don't know
specifically what changed, but it's looking like something started
rejecting malformed URLs. Try adding "http://; or "https://; to your
URL (whichever is appropriate) and see if both versions will accept
it.

ChrisA



I did that, obtaining the following URL

https://wiki.[…]/lib/exe/xmlrpc.php?u=[…]=[…]

on my two currently available computer (laptop on 3.9, remote on 3.7), 
and the results is the same.


For information, i'm uploading the same python program to my remote 
server (debian, 3.7), and running it with the same parameters as my 
laptop (manjaro, 3.9). My laptop is getting the 401, my server is 
getting the expected dokuwiki version.


--lucas
--
https://mail.python.org/mailman/listinfo/python-list


Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-02-24 Thread Chris Angelico
On Thu, Feb 25, 2021 at 2:02 AM lucas  wrote:
>
> Hi everyone,
>
> (Sorry for the double-send if any, i'm not sure the first send was
> performed, maybe because of bounce errors according to mailman.)
>
>
> I'm currently trying to understand an error when using the
> dokuwikixmlrpc python module, allowing to easily work with DokuWiki RPC
> interface.
>
> Another description of the problem :
> https://github.com/kynan/dokuwikixmlrpc/issues/8
>
> Here is the code, tailored to work with the DokuWiki RPC interface:
>
>  from urllib.parse import urlencode
>  import xmlrpc.client as xmlrpclib
>
>  URL = 'wiki.example.net'
>  USER = 'user'
>  PASSWD = 'password'
>  USER_AGENT = 'DokuWikiXMLRPC  1.0  for testing'
>
>  script = '/lib/exe/xmlrpc.php'
>  url = URL + script + '?' + urlencode({'u': USER, 'p': PASSWD})
>  xmlrpclib.Transport.user_agent = USER_AGENT
>  xmlrpclib.SafeTransport.user_agent = USER_AGENT
>  proxy = xmlrpclib.ServerProxy(url)
>
>  v = proxy.dokuwiki.getVersion()
>  print(v)
>
> When ran with Python 3.7 (a personnal debian server, or a personal
> windows computer), i obtain the expected 'Release 2018-04-22a "Greebo"'
> as ouput.
> When ran with Python 3.9 (my personnal, manjaro machine), i obtain the
> following stacktrace:
>
>  Traceback (most recent call last):
>File "/home/project/read.py", line 32, in 
>  v = proxy.dokuwiki.getVersion()
>File "/usr/lib/python3.9/xmlrpc/client.py", line 1116, in __call__
>  return self.__send(self.__name, args)
>File "/usr/lib/python3.9/xmlrpc/client.py", line 1456, in __request
>  response = self.__transport.request(
>File "/usr/lib/python3.9/xmlrpc/client.py", line 1160, in request
>  return self.single_request(host, handler, request_body, verbose)
>File "/usr/lib/python3.9/xmlrpc/client.py", line 1190, in
> single_request
>  raise ProtocolError(
>  xmlrpc.client.ProtocolError:  wiki.example.net/lib/exe/xmlrpc.php: 401 Unauthorized>
>

A properly-formed URL will start with a protocol. I don't know
specifically what changed, but it's looking like something started
rejecting malformed URLs. Try adding "http://; or "https://; to your
URL (whichever is appropriate) and see if both versions will accept
it.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-02-24 Thread lucas

Hi, thanks for your answer !

I updated everything, including certificates, while upgrading to python 
3.9, and retried today (no new certificates to install). I am the 
administrator of the wiki i try to access, and didn't do black magic in 
the configuration..


The error really seems to came from 3.8 or 3.9, since i can still reach 
the wiki nominally with my (some being non-updated) machines using 
python 3.7. This didn't evolve since i discovered the problem few days ago.


--lucas


On 24/02/2021 16:20, 2qdxy4rzwzuui...@potatochowder.com wrote:

On 2021-02-24 at 15:29:58 +0100,
lucas  wrote:


I'm currently trying to understand an error when using the dokuwikixmlrpc
python module, allowing to easily work with DokuWiki RPC interface.

Another description of the problem :
https://github.com/kynan/dokuwikixmlrpc/issues/8

Here is the code, tailored to work with the DokuWiki RPC interface:

 from urllib.parse import urlencode
 import xmlrpc.client as xmlrpclib

 URL = 'wiki.example.net'
 USER = 'user'
 PASSWD = 'password'
 USER_AGENT = 'DokuWikiXMLRPC  1.0  for testing'

 script = '/lib/exe/xmlrpc.php'
 url = URL + script + '?' + urlencode({'u': USER, 'p': PASSWD})
 xmlrpclib.Transport.user_agent = USER_AGENT
 xmlrpclib.SafeTransport.user_agent = USER_AGENT
 proxy = xmlrpclib.ServerProxy(url)

 v = proxy.dokuwiki.getVersion()
 print(v)

When ran with Python 3.7 (a personnal debian server, or a personal windows
computer), i obtain the expected 'Release 2018-04-22a "Greebo"' as ouput.
When ran with Python 3.9 (my personnal, manjaro machine), i obtain the
following stacktrace:

 Traceback (most recent call last):
   File "/home/project/read.py", line 32, in 
 v = proxy.dokuwiki.getVersion()
   File "/usr/lib/python3.9/xmlrpc/client.py", line 1116, in __call__
 return self.__send(self.__name, args)
   File "/usr/lib/python3.9/xmlrpc/client.py", line 1456, in __request
 response = self.__transport.request(
   File "/usr/lib/python3.9/xmlrpc/client.py", line 1160, in request
 return self.single_request(host, handler, request_body, verbose)
   File "/usr/lib/python3.9/xmlrpc/client.py", line 1190, in
single_request
 raise ProtocolError(
 xmlrpc.client.ProtocolError: 


At the risk of stating the obvious, it might actually be an
authentication problem.  In addition to double checking the password:

(1) make sure all of your certificates (under Arch Linux, on which
Manjaro is based), that's the ca-certificates package) are up to date;
and

(2) check with whoever owns the wiki about any other certificates they
require.

After that, all I know about XML RPC is to avoid it.  :-)


I don't have the possibility to test this on python 3.8 specifically, but
since the XML and XMLRPC modules have been updated in 3.8, and since 3.9
doesn't seems to introduce any change for them, i would expect 3.8 to
introduce some change that dokuwikixmlrpc has somehow to take into
consideration.

Can anyone help me with that one ? I don't know anything about RPC and XML,
i don't know what i need to do know to fix dokuwikixmlrpc.

--
https://mail.python.org/mailman/listinfo/python-list


Re: XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-02-24 Thread 2QdxY4RzWzUUiLuE
On 2021-02-24 at 15:29:58 +0100,
lucas  wrote:

> I'm currently trying to understand an error when using the dokuwikixmlrpc
> python module, allowing to easily work with DokuWiki RPC interface.
> 
> Another description of the problem :
>   https://github.com/kynan/dokuwikixmlrpc/issues/8
> 
> Here is the code, tailored to work with the DokuWiki RPC interface:
> 
> from urllib.parse import urlencode
> import xmlrpc.client as xmlrpclib
> 
> URL = 'wiki.example.net'
> USER = 'user'
> PASSWD = 'password'
> USER_AGENT = 'DokuWikiXMLRPC  1.0  for testing'
> 
> script = '/lib/exe/xmlrpc.php'
> url = URL + script + '?' + urlencode({'u': USER, 'p': PASSWD})
> xmlrpclib.Transport.user_agent = USER_AGENT
> xmlrpclib.SafeTransport.user_agent = USER_AGENT
> proxy = xmlrpclib.ServerProxy(url)
> 
> v = proxy.dokuwiki.getVersion()
> print(v)
> 
> When ran with Python 3.7 (a personnal debian server, or a personal windows
> computer), i obtain the expected 'Release 2018-04-22a "Greebo"' as ouput.
> When ran with Python 3.9 (my personnal, manjaro machine), i obtain the
> following stacktrace:
> 
> Traceback (most recent call last):
>   File "/home/project/read.py", line 32, in 
> v = proxy.dokuwiki.getVersion()
>   File "/usr/lib/python3.9/xmlrpc/client.py", line 1116, in __call__
> return self.__send(self.__name, args)
>   File "/usr/lib/python3.9/xmlrpc/client.py", line 1456, in __request
> response = self.__transport.request(
>   File "/usr/lib/python3.9/xmlrpc/client.py", line 1160, in request
> return self.single_request(host, handler, request_body, verbose)
>   File "/usr/lib/python3.9/xmlrpc/client.py", line 1190, in
> single_request
> raise ProtocolError(
> xmlrpc.client.ProtocolError:  wiki.example.net/lib/exe/xmlrpc.php: 401 Unauthorized>

At the risk of stating the obvious, it might actually be an
authentication problem.  In addition to double checking the password:

(1) make sure all of your certificates (under Arch Linux, on which
Manjaro is based), that's the ca-certificates package) are up to date;
and

(2) check with whoever owns the wiki about any other certificates they
require.

After that, all I know about XML RPC is to avoid it.  :-)

> I don't have the possibility to test this on python 3.8 specifically, but
> since the XML and XMLRPC modules have been updated in 3.8, and since 3.9
> doesn't seems to introduce any change for them, i would expect 3.8 to
> introduce some change that dokuwikixmlrpc has somehow to take into
> consideration.
> 
> Can anyone help me with that one ? I don't know anything about RPC and XML,
> i don't know what i need to do know to fix dokuwikixmlrpc.
-- 
https://mail.python.org/mailman/listinfo/python-list


XML RPC changes between 3.7 and 3.9 yield 401 http error

2021-02-24 Thread lucas

Hi everyone,

(Sorry for the double-send if any, i'm not sure the first send was 
performed, maybe because of bounce errors according to mailman.)



I'm currently trying to understand an error when using the 
dokuwikixmlrpc python module, allowing to easily work with DokuWiki RPC 
interface.


Another description of the problem :
https://github.com/kynan/dokuwikixmlrpc/issues/8

Here is the code, tailored to work with the DokuWiki RPC interface:

from urllib.parse import urlencode
import xmlrpc.client as xmlrpclib

URL = 'wiki.example.net'
USER = 'user'
PASSWD = 'password'
USER_AGENT = 'DokuWikiXMLRPC  1.0  for testing'

script = '/lib/exe/xmlrpc.php'
url = URL + script + '?' + urlencode({'u': USER, 'p': PASSWD})
xmlrpclib.Transport.user_agent = USER_AGENT
xmlrpclib.SafeTransport.user_agent = USER_AGENT
proxy = xmlrpclib.ServerProxy(url)

v = proxy.dokuwiki.getVersion()
print(v)

When ran with Python 3.7 (a personnal debian server, or a personal 
windows computer), i obtain the expected 'Release 2018-04-22a "Greebo"' 
as ouput.
When ran with Python 3.9 (my personnal, manjaro machine), i obtain the 
following stacktrace:


Traceback (most recent call last):
  File "/home/project/read.py", line 32, in 
v = proxy.dokuwiki.getVersion()
  File "/usr/lib/python3.9/xmlrpc/client.py", line 1116, in __call__
return self.__send(self.__name, args)
  File "/usr/lib/python3.9/xmlrpc/client.py", line 1456, in __request
response = self.__transport.request(
  File "/usr/lib/python3.9/xmlrpc/client.py", line 1160, in request
return self.single_request(host, handler, request_body, verbose)
  File "/usr/lib/python3.9/xmlrpc/client.py", line 1190, in 
single_request

raise ProtocolError(
xmlrpc.client.ProtocolError: wiki.example.net/lib/exe/xmlrpc.php: 401 Unauthorized>


I don't have the possibility to test this on python 3.8 specifically, 
but since the XML and XMLRPC modules have been updated in 3.8, and since 
3.9 doesn't seems to introduce any change for them, i would expect 3.8 
to introduce some change that dokuwikixmlrpc has somehow to take into 
consideration.


Can anyone help me with that one ? I don't know anything about RPC and 
XML, i don't know what i need to do know to fix dokuwikixmlrpc.


Best regard,
--lucas
--
https://mail.python.org/mailman/listinfo/python-list


[issue28968] xml rpc server fails with connection reset by peer error no 104

2016-12-23 Thread Martin Panter

Martin Panter added the comment:

Python 2.6 is quite old and doesn’t even receive security patches any more as 
far as I know. I would start by trying 2.7, or failing that, try backporting 
the changes from Issue 6267. My guess is this is related to persistent HTTP 
connections being dropped.

I don’t think the bug tracker is the right place to discuss 2.6 these days. 
Even if you can find someone interested in helping with 2.6, you may need to 
provide more information (e.g. client and server code) to produce the problem.

--
nosy: +martin.panter
resolution:  -> out of date

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28968] xml rpc server fails with connection reset by peer error no 104

2016-12-22 Thread Manish Singh

Manish Singh added the comment:

Below is the information sent to python-dev group

===

[ Issue ]
I have used xml rpc library with transport as http. My client and server are 
running on same host.

Some xml rpc requests fail with connection reset by peer error number. I have 
used xmlrpclib.ServerProxy() to call remote method on xml rpc server running on 
an ephemeral port.

This issue has happen many times.

log snippet,

  File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
verbose=self.__verbose
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1237, in request
errcode, errmsg, headers = h.getreply()
  File "/usr/lib64/python2.6/httplib.py", line 1064, in getreply
response = self._conn.getresponse()
  File "/usr/lib64/python2.6/httplib.py", line 990, in getresponse
response.begin()
  File "/usr/lib64/python2.6/httplib.py", line 391, in begin
version, status, reason = self._read_status()
  File "/usr/lib64/python2.6/httplib.py", line 349, in _read_status
line = self.fp.readline()
  File "/usr/lib64/python2.6/socket.py", line 433, in readline
data = recv(1)
error: [Errno 104] Connection reset by peer

[ Test Environment ]
RHEL 6 with linux kernel 2.6.32-504.16.2.el6.
Python 2.6.6
glibc-2.12-1.149.7


[ Possible Reasons for it ]

1) The machine is connected to the network, and the network is not responsive. 
2) The other side of the connection is not running normally. 
3) There are not enough system resources available. Free up system resources if 
they are running low. 

Possibility for 1 and 2 are not applicable as it is loop back 
communication(Client and Server running on same machine).
For Possibility 3, I have already checked system resource and there are enough 
resources(80% RAM used, 20% cpu usage, around 10 GB RAM free).

I checked for other reasons and i found that this issue may be related with GIL,
Please refer this link,
http://stackoverflow.com/questions/383738/104-connection-reset-by-peer-socket-error-or-when-does-closing-a-socket-resu
 

1> Can you please let me know, is it really a issue realted with GIL?
2> If yes, How to resolve this issue?
3> If no, what other reason may exists for such failure. [Note: Those rpc 
requests fail which return python's dictionary data to client]




--

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28968>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28968] xml rpc server fails with connection reset by peer error no 104

2016-12-22 Thread Manish Singh

Manish Singh added the comment:

Hi Jim,
Thank you for replying.

As you are suggesting that there is a firewall setting.

Then in that case every request should fail, right?

But in my case only few request fail(4 out 20 requests).

Have you seen my mail sent to python-dev group through gmail?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28968] xml rpc server fails with connection reset by peer error no 104

2016-12-22 Thread Jim Jewett

Jim Jewett added the comment:

When I see a message like that, it normally means there is a firewall getting 
in my way.

--
nosy: +Jim.Jewett

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28968] xml rpc server fails with connection reset by peer error no 104

2016-12-21 Thread R. David Murray

R. David Murray added the comment:

The python-list mailing list subscription info can be found on the 
mail.python.org web page.  It is also gatewayed to a usenet news group.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28968] xml rpc server fails with connection reset by peer error no 104

2016-12-21 Thread Manish Singh

Manish Singh added the comment:

Hi David,

How can i port it to main python-dev list.

Need to mail on it or some other group is there so that we can send the message 
to it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28968] xml rpc server fails with connection reset by peer error no 104

2016-12-20 Thread R. David Murray

R. David Murray added the comment:

I'm sorry, I don't have time to dig in to this right now.  Hopefully someone 
else can pick it up.  You might try posting on the python-list mailing list, 
there are several core devs who hang out there and might be interested in the 
problem.

--
nosy:  -loewis

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28968] xml rpc server fails with connection reset by peer error no 104

2016-12-19 Thread Manish Singh

Manish Singh added the comment:

Hi Davud Murray,

Can you reply to above comments.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28968] xml rpc server fails with connection reset by peer error no 104

2016-12-16 Thread Manish Singh

Manish Singh added the comment:

Hi David Murray,

Please refer this link,

http://stackoverflow.com/questions/383738/104-connection-reset-by-peer-socket-error-or-when-does-closing-a-socket-resu

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28968] xml rpc server fails with connection reset by peer error no 104

2016-12-15 Thread Manish Singh

Manish Singh added the comment:

Hi David Murray,
Thanks for replying.

I have mentioned that my client and server are running on same host. So 
communication is going through localhost address.

I have checked for possible reasons of connection reset by peer error, below 
are the possible causes,

1) The machine is connected to the network, and the network is not responsive. 
2) The other side of the connection is not running normally. 
3) There are not enough system resources available. Free up system resources if 
they are running low. 

Possibility for 1 and 2 are not applicable as it is loopback communication.

For Possibility 3, I have already checked system resource and there are enough 
resources. 

You can check below stack overflow link.
http://stackoverflow.com/questions/1434451/what-does-connection-reset-by-peer-mean?rq=1

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28968] xml rpc server fails with connection reset by peer error no 104

2016-12-15 Thread R. David Murray

R. David Murray added the comment:

Connection reset by peer means the far end has terminated the connection.  
You'll probably need to do some protocol analysis (wireshark or a similar tool) 
to find out why the connection is being dropped, or perhaps you can look at the 
far end logging.  As it is, there isn't enough information here to speculate as 
to a cause, or if there is any bug in the python library code.

(FYI Martin von Loewis hasn't had much time for CPython development lately, so 
I doubt he'll respond.)

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28968] xml rpc server fails with connection reset by peer error no 104

2016-12-14 Thread Manish Singh

Changes by Manish Singh :


--
nosy: +loewis

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28968] xml rpc server fails with connection reset by peer error no 104

2016-12-14 Thread Manish Singh

Manish Singh added the comment:

Hi loewis,

Can you please look into this issue

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28968] xml rpc server fails with connection reset by peer error no 104

2016-12-14 Thread Manish Singh

New submission from Manish Singh:

I have used xml rpc library with transport http. My client and server are 
running on same host.

In normal load scenario(20% cpu usage, 80% memory usage, 18 GB memory free), 
some request of xml rpc client fails with connection reset by peer error. I 
have used xmlrpclib.ServerProxy() to call remote method on xml rpc server 
running on an empherial port.

This issue has happen many times.

log snippet,

  File "/usr/lib64/python2.6/xmlrpclib.py", line 1489, in __request
verbose=self.__verbose
  File "/usr/lib64/python2.6/xmlrpclib.py", line 1237, in request
errcode, errmsg, headers = h.getreply()
  File "/usr/lib64/python2.6/httplib.py", line 1064, in getreply
response = self._conn.getresponse()
  File "/usr/lib64/python2.6/httplib.py", line 990, in getresponse
response.begin()
  File "/usr/lib64/python2.6/httplib.py", line 391, in begin
version, status, reason = self._read_status()
  File "/usr/lib64/python2.6/httplib.py", line 349, in _read_status
line = self.fp.readline()
  File "/usr/lib64/python2.6/socket.py", line 433, in readline
data = recv(1)
error: [Errno 104] Connection reset by peer

--
components: Library (Lib)
messages: 283180
nosy: manu
priority: normal
severity: normal
status: open
title: xml rpc server fails with connection reset by peer error no 104
type: behavior
versions: Python 2.7

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28968>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25080] The example-code for making XML-RPC requests through proxy, fail!

2016-02-22 Thread Berker Peksag

Berker Peksag added the comment:

This has been fixed in cf842a8ccb77. Thank you for reporting this, Kostis!

--
nosy: +berker.peksag
resolution:  -> out of date
stage: needs patch -> resolved
status: open -> closed
versions:  -Python 3.4

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9006] xml-rpc Server object does not propagate the encoding to Unmarshaller

2016-01-18 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 04e95f05aafe by Serhiy Storchaka in branch '2.7':
Issue #9006: Added tests for XML RPC with non-UTF-8 encoding.
https://hg.python.org/cpython/rev/04e95f05aafe

New changeset 59cb8811286a by Serhiy Storchaka in branch '3.5':
Issue #9006: Added tests for XML RPC with non-UTF-8 encoding.
https://hg.python.org/cpython/rev/59cb8811286a

New changeset 96a7603d25ea by Serhiy Storchaka in branch 'default':
Issue #9006: Added tests for XML RPC with non-UTF-8 encoding.
https://hg.python.org/cpython/rev/96a7603d25ea

--
nosy: +python-dev

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9006>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9006] xml-rpc Server object does not propagate the encoding to Unmarshaller

2016-01-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> rejected
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9006] xml-rpc Server object does not propagate the encoding to Unmarshaller

2016-01-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

xmlrpc uses XML. This format includes information about the encoding and 
doesn't need external specification.

The server in the example is not correct. It generates XML with default XML 
declaration that implies the UTF-8 encoding, but the body is encoded with 
non-UTF-8 encoding. If add the argument encoding='UTF-8' the example works.

But this feature is not covered by tests. Proposed patch adds tests for 
non-default client and server encodings. No changes for the xmlrpc module 
itself is needed.

--
assignee:  -> serhiy.storchaka
components: +Tests
keywords: +patch
nosy: +serhiy.storchaka
stage:  -> patch review
type: behavior -> enhancement
versions: +Python 3.5, Python 3.6 -Python 3.1, Python 3.2
Added file: http://bugs.python.org/file41633/test_xmlrpc_encoding-2.7.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9006] xml-rpc Server object does not propagate the encoding to Unmarshaller

2016-01-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file41634/test_xmlrpc_encoding-3.5.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue25080] The example-code for making XML-RPC requests through proxy, fail!

2015-09-15 Thread Raymond Hettinger

Changes by Raymond Hettinger <raymond.hettin...@gmail.com>:


--
title: The example-code for making XLM-RPC requests through proxy, fail! -> The 
example-code for making XML-RPC requests through proxy, fail!

___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue25080>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Fwd: Request for Information XML-RPC (Python)

2015-07-30 Thread dieter
Davide D'Arenzo davide.dare...@gmail.com writes:

 I'm Davide D'Arenzo and I'm working with Python using the standard
 xmlrpclib library communicating between a JavaServer (that host xmlrpc
 server) and my python client. I have a problem and I hope that you should
 solve my issue.

 I want to send a DOM instance through xmlrpc protocol. I know that the
 istance are impossible to manage by xmlrpclib library in Python but this is
 what I need.

XML-RPC supports only a very small set of elementary types - and
DOM instance does not belong to this set.

Thus, you must ask your server administrator as what type the server
expects to get the XML (this may either by string or binary; I suppose,
it will be binary). You then convert your DOM instance into an
XML document, potentially using an appropriate encoding (likely utf-8),
and potentially wrap it into xmlrpclib's binary wrapper (in case,
the server expects a binary string).


-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Fwd: Request for Information XML-RPC (Python)

2015-07-29 Thread Irmen de Jong
On 29-7-2015 14:52, Davide D'Arenzo wrote:

 I want to send a DOM instance through xmlrpc protocol. I know that the 
 istance are
 impossible to manage by xmlrpclib library in Python but this is what I need. 
 I'm trying
 to understand why is not possible to marshal the class Nodelist and I 
 recognize that the
 target function is dumps(self, values) in class Marshaller because she 
 couldn't find
 this type of Python Object.

One serialized form of a DOM is an XML document. So why not just send the 
XML
document itself?

Just ask the dom for its string/xml form and send that as a string across your 
xml-rpc call.

Irmen

-- 
https://mail.python.org/mailman/listinfo/python-list


Fwd: Request for Information XML-RPC (Python)

2015-07-29 Thread Davide D'Arenzo
Goodmorning dear Team,

I'm Davide D'Arenzo and I'm working with Python using the standard
xmlrpclib library communicating between a JavaServer (that host xmlrpc
server) and my python client. I have a problem and I hope that you should
solve my issue.

I want to send a DOM instance through xmlrpc protocol. I know that the
istance are impossible to manage by xmlrpclib library in Python but this is
what I need. I'm trying to understand why is not possible to marshal the
class Nodelist and I recognize that the target function is dumps(self,
values) in class Marshaller because she couldn't find this type of Python
Object.

For Instance, the Fault code is this:

Traceback (most recent call last):
  File testRestSwi.py, line 31, in module
conn.xxx.xxx(dom3,xxx,xxx)
  File /usr/lib/python2.7/xmlrpclib.py, line 1224, in __call__
return self.__send(self.__name, args)
  File /usr/lib/python2.7/xmlrpclib.py, line 1572, in __request
allow_none=self.__allow_none)
  File /usr/lib/python2.7/xmlrpclib.py, line 1085, in dumps
data = m.dumps(params)
  File /usr/lib/python2.7/xmlrpclib.py, line 632, in dumps
dump(v, write)
  File /usr/lib/python2.7/xmlrpclib.py, line 654, in __dump
f(self, value, write)
  File /usr/lib/python2.7/xmlrpclib.py, line 756, in dump_instance
self.dump_struct(value.__dict__, write)
  File /usr/lib/python2.7/xmlrpclib.py, line 735, in dump_struct
dump(v, write)
  File /usr/lib/python2.7/xmlrpclib.py, line 646, in __dump
raise TypeError, cannot marshal %s objects % type(value)
TypeError: cannot marshal class 'xml.dom.minicompat.NodeList' objects

Now, I would want to solve this problem and for sure there are many
solutions. But I don't know how to develop or implement something within
the xmlrpclib in order to avoid the marshalling problem. Keep in mind
that the file object must be a DOM, is aim, uncheangeable.

For Instance, I'm developing the following:
import xml.dom.minidom as parser
import xmlrpclib
dom3 = parser.parseString(xxx)
conn = xmlrpclib.ServerProxy('xxx',allow_none=True,verbose=True)
conn.xxx.xxx(dom3,xxx,xxx) #--- The problem Here.

Might you help me?
Thank you a lot.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue11084] Serialization of decimal.Decimal to XML-RPC

2013-10-13 Thread Georg Brandl

Georg Brandl added the comment:

Adding a special case for Decimal isn't as well justified as one for None -- 
after all it is a fundamental singleton. (Also, None is encoded without lossy 
conversion.)

The encoder/decoder are already extensible by extending Marshaller.dispatch and 
Unmarshaller.dispatch.

--
nosy: +georg.brandl
resolution:  - rejected
status: pending - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11084
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11084] Serialization of decimal.Decimal to XML-RPC

2013-05-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
status: open - pending

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11084
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8792] Support Apache extensions to XML-RPC in xmlrpclib

2012-10-21 Thread Brian Quinlan

Brian Quinlan added the comment:

I'm closing this since the filer hasn't specified exactly what they want.

--
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8792
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



RE: xml-rpc server on wine

2011-11-08 Thread Prasad, Ramit
 Hi, I have a XML-RPC server python running on VM Windows (on Linux)
 and a XML-RPC client python on Linux. Server and client have different
 IP address. I'd like migrate server on wine. How can communicate
 server and client? IP address is different or is the same?
 Can you help me?

Not really, this doesn't have much of anything to do with Python.  If
you run a network application on wine [assuming that even works] the
application will have the same IP/interface as any other application or
service running on the host.  Wine is not a 'virtualization' solution.

Unless you have a specific need to run it in a virtual machine (which 
WINE is not), why not run it directly from Linux? I generally prefer
to use a DNS name or hostname to connect instead of IP because the
IP addresses can be dynamic (especially when you start accessing it 
from outside your local network). Even internally, I tend to use hostnames
and not IP addresses, but mostly because it is faster/easier for me 
to type (I assign static IPs internally).

Ramit


Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423

--
This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: xml-rpc server on wine

2011-11-07 Thread Adam Tauno Williams
On Sat, 2011-11-05 at 05:50 -0700, pacopyc wrote:
 Hi, I have a XML-RPC server python running on VM Windows (on Linux)
 and a XML-RPC client python on Linux. Server and client have different
 IP address. I'd like migrate server on wine. How can communicate
 server and client? IP address is different or is the same?
 Can you help me?

Not really, this doesn't have much of anything to do with Python.  If
you run a network application on wine [assuming that even works] the
application will have the same IP/interface as any other application or
service running on the host.  Wine is not a 'virtualization' solution.


-- 
http://mail.python.org/mailman/listinfo/python-list


xml-rpc server on wine

2011-11-05 Thread pacopyc
Hi, I have a XML-RPC server python running on VM Windows (on Linux)
and a XML-RPC client python on Linux. Server and client have different
IP address. I'd like migrate server on wine. How can communicate
server and client? IP address is different or is the same?
Can you help me?

Thanks
-- 
http://mail.python.org/mailman/listinfo/python-list


Python script xml-rpc to C# xml-rpc script

2011-03-15 Thread Ymtrader
If anyone is fluent in python as well as C# using the cook computing 
xml-rpc.net library I could really use some help.  I have been trying to write 
a C# program to access upcdatabase.com without much luck. I have a working 
python script. Would anyone be willing to show me the C# equivalent to this 
python script might be. Thank you

#!/usr/bin/env python
#
#

import sys
from xmlrpclib import ServerProxy, Error

rpc_key = 'enter rpc_key here'

if __name__=='__main__':
if len(sys.argv) != 2:
print 'Usage: fetchupc.py upc'
exit
else:
s = ServerProxy('http://www.upcdatabase.com/xmlrpc')
params = { 'rpc_key': rpc_key, 'upc': sys.argv[1] }
print s.lookup(params)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python script xml-rpc to C# xml-rpc script

2011-03-15 Thread Adam Tauno Williams
On Tue, 2011-03-15 at 08:00 -0700, Ymtrader wrote:
 If anyone is fluent in python as well as C# using the cook computing
 xml-rpc.net library I could really use some help.  I have been trying
 to write a C# program to access upcdatabase.com without much luck. 

Yes,  I've used both.

  have a working python script. Would anyone be willing to show me the
 C# equivalent to this python script might be. Thank you

If you ask on an appropriate forum - yes.  [the cook computing forum or
the Mono list].  This is *not* a Python question.

-- 
http://mail.python.org/mailman/listinfo/python-list


[issue11084] Serialization of decimal.Decimal to XML-RPC

2011-02-01 Thread Mark Dickinson

Changes by Mark Dickinson dicki...@gmail.com:


--
nosy: +mark.dickinson

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11084
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11084] Serialization of decimal.Decimal to XML-RPC

2011-01-31 Thread GDR!

New submission from GDR! g...@go2.pl:

xmlrpc.client (and xmlrpclib in 2.x) can't serialize instances of Decimal, 
throwing TypeError instead. Because XML is a textual format, converting from 
decimal to float may cause loss of data.

According to http://www.xmlrpc.com/spec, encoding Decimal as XML-RPC double / 
is allowed: The range of allowable values is implementation-dependent, is not 
specified. Therefore, including decimal numbers that can not be represented by 
IEEE double is allowed by the spec.

Also, in my opinion, making a numeric type available in standard library 
unsupported by another part of standard library, is counterintuitive, but it's 
just my personal point of view.

I can provide a patch if this bug report is considered proper.

--
components: Library (Lib)
messages: 127651
nosy: gdr
priority: normal
severity: normal
status: open
title: Serialization of decimal.Decimal to XML-RPC
type: behavior
versions: Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11084
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11084] Serialization of decimal.Decimal to XML-RPC

2011-01-31 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

-1 on an implicit, lossy conversion.

The principal reasons for using decimal in the first place is avoid 
representation error.  For example, when money is being represented as a 
decimal, it is improper to convert it to float (where it can no longer be 
compared for equality and where the representable range is smaller).

A user needs explicit control in this situation, converting to float when it 
doesn't matter, or using an API that allows the decimal repr to be handled.

One other issue is that in an RPC environment, good design suggests that the 
client do its best to match the type expectations for of the functions on the 
server.  Implicit signature changing makes even less sense for RPC than it does 
in a regular application.

--
nosy: +rhettinger
type: behavior - feature request
versions: +Python 3.3 -Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11084
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11084] Serialization of decimal.Decimal to XML-RPC

2011-01-31 Thread GDR!

GDR! g...@go2.pl added the comment:

I didn't mean to implicitly convert Decimal to float. My point was that 
xmlrpclib should serialize Decimals natively to avoid loss of precision when 
converting to float and then to string.

Whether other party will be able to represent this number exactly or not should 
not be our issue. 

To make it more clear, this is what Python currently does:
http://gdr.pastebin.pl/35766
this is what I propose it shoud do:
http://gdr.pastebin.pl/35765

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11084
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11084] Serialization of decimal.Decimal to XML-RPC

2011-01-31 Thread GDR!

GDR! g...@go2.pl added the comment:

Also, I think that double should be represented as Decimal when unmarshalling 
XML-RPC data, because the standard doesn't give any limits on size on precision 
of data, and the only representation it allows is the one with decimal point, 
making it an excellent fit for Decimal.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11084
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11084] Serialization of decimal.Decimal to XML-RPC

2011-01-31 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

 x = decimal.Decimal('9.11')
 c.dumps(x,), 'whatever')
?xml 
version='1.0'?\nmethodCall\nmethodNamewhatever/methodName\nparams\nparam\nvaluedouble9.11/double/value\n/param\n/params\n/methodCall\n

That's what I though you meant and I don't think it is wise.  The RPC spec is 
all about interoperability.  The double tag means double-precision signed 
floating point number so what you're proposing an implicit type conversion 
(i.e. the client sends a decimal and the server receives a float).

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11084
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11084] Serialization of decimal.Decimal to XML-RPC

2011-01-31 Thread GDR!

GDR! g...@go2.pl added the comment:

While it would be allowed by the spec in the quotation I pasted in the original 
post, I understand your point, it makes sense. 

I still think, however, that it should be available at least as an option. 
There already is allow_none parameter available when marshaling. Another 
solution would be to allow something like json.JSONEncoder.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11084
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8792] Support Apache extensions to XML-RPC in xmlrpclib

2010-11-18 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

 An addition: It was reported in #10425 that None values are
 incorrectly serialized as valuenil//value, instead of just
 nil/, or maybe {namespace prefix for extensions defined by
 Apache}:nil/.

This is not incorrect, but follows the specification of the nil
element, see, for example

http://en.wikipedia.org/wiki/XML-RPC

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8792
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8792] Support Apache extensions to XML-RPC in xmlrpclib

2010-11-16 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

An addition: It was reported in #10425 that None values are incorrectly 
serialized as valuenil//value, instead of just nil/, or maybe 
{namespace prefix for extensions defined by Apache}:nil/.

--
nosy: +Adam.Bielański, eric.araujo, orsenthil

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8792
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8792] Support Apache extensions to XML-RPC in xmlrpclib

2010-11-16 Thread Adam Bielański

Adam Bielański abg...@gmail.com added the comment:

To make example provided by Amaury complete I'll add that in order to support 
both ways you also need to replace xmlrpclib.dumps() with code from attached 
file.

Changes to original xmlrpclib.dumps() function are outlined with comments. In 
short - it adds namespace declarations to methodCall and methodResponse 
elements and also makes Marshaller produce ex:nil/ instead of nil/

--
Added file: http://bugs.python.org/file19619/dumps_with_namespace.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8792
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9006] xml-rpc Server object does not propagate the encoding to Unmarshaller

2010-11-11 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Could you reupload your fix as a diff instead of a whole file?  See 
http://www.python.org/dev/patches/ for some help.

--
nosy: +loewis
type: crash - behavior
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9006
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8792] Support Apache extensions to XML-RPC in xmlrpclib

2010-10-02 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

It's easy enough to subclass the Transport type and add custom types to the 
dispatcher object, see the script below.
Attila, Bhargav, is this solution acceptable to you?


from xmlrpclib import Transport, ServerProxy

class MyTransport(Transport):
def getparser(self):
parser, unmarshaller = Transport.getparser(self)

# Get the class attribute, clone it
dispatch = unmarshaller.dispatch.copy()
# and store it on the instance
unmarshaller.dispatch = dispatch

# Now we can add custom types
dispatch[ex:i8] = dispatch[int]

return parser, unmarshaller

uri = http://time.xmlrpc.com/RPC2;
server = ServerProxy(uri, transport=MyTransport(use_datetime=True))
print server.currentTime.getCurrentTime()

--
nosy: +amaury.forgeotdarc

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8792
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8190] Add a PyPI XML-RPC client module

2010-10-01 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

My bad, I took Tarek’s line about “implementing all functions” literally.  Your 
client classes don’t have methods with the same exact names and signatures, but 
what matters is that they provide the functionality.  If you can review the 
functions listed on the XML-RPC wiki page and confirm they have an equivalent 
in d2.index, this bug will be closed :)  Bonus points if you create a wiki page 
explaining how to do operations listed on the XML-RPC page in distutils2.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8190
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8190] Add a PyPI XML-RPC client module

2010-10-01 Thread Alexis Metaireau

Alexis Metaireau ametair...@gmail.com added the comment:

Yes, all the functions are covered. By the way, I've covered all the functions 
based on the pypi source code, not on the wiki.

I'll update the wiki page with some examples soon :)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8190
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8190] Add a PyPI XML-RPC client module

2010-10-01 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
resolution: accepted - fixed
stage: patch review - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8190
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8190] Add a PyPI XML-RPC client module

2010-09-30 Thread Alexis Metaireau

Alexis Metaireau ametair...@gmail.com added the comment:

Please, can you be a bit more precise about the missing features ? I'll be glad 
to cover them.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8190
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8190] Add a PyPI XML-RPC client module

2010-09-29 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

distutils2.index implements an XML-RPC client, a crawler for the so-called 
simple index and a wrapper for them.  A quick test showed that not all calls 
listed on the wiki page work now; Alexis, can you give us a status update?

--
resolution:  - accepted
stage: needs patch - patch review
versions: +3rd party

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8190
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8792] xmlrpclib compatibility issues with Apache XML-RPC library

2010-07-24 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

Can somebody please point to a current version of the Apache documentation? The 
link in msg106322 does not work anymore.

I'm tempted to close this as invalid: Apache is clearly violating the XML-RPC 
specification, so the bug is theirs.

As a work-around, adding this to dispatch in your own application seems like a 
good solution to me.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8792
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8792] Support Apache extensions to XML-RPC in xmlrpclib

2010-07-24 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

I just noticed that I only need to strip the comma from the URL.

So I now see it's not an Apache bug, but explicitly marked as an extension. So 
I'm reclassifying this as a feature request. As a new feature, it can only go 
into 3.2.

Attila, Bhargav: is either of you interested in providing a patch?

--
priority: normal - low
title: xmlrpclib compatibility issues with Apache XML-RPC library - Support 
Apache extensions to XML-RPC in xmlrpclib
type: behavior - feature request
versions: +Python 3.3 -Python 2.6, Python 2.7, Python 3.1

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8792
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8792] Support Apache extensions to XML-RPC in xmlrpclib

2010-07-24 Thread Bhargav

Bhargav bhar...@bluejeansnet.com added the comment:

What I do is not a possible solution, because some other machine might add 
e:nil, what we need is XML namespace parsing.

Also I can't really use my solution, as it makes my client non-portable, I cant 
move it from my dev machine to production at all.

This is just a workaround so that I am not stuck at ex:nil for my development.

I am not an expert in xmlrpc nor in python to really contribute a patch, but if 
I could really do think of something, I will contribute it.

Having said that, I know for sure the server works for Java clients and I have 
heard it works for .Net.

I know this is not a standard, but a widely used and published extension, and 
hence I think we should atleast port it back to the 2.7 branch as not everyone 
has moved to python 3 yet.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8792
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8792] Support Apache extensions to XML-RPC in xmlrpclib

2010-07-24 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

Adding it to 2.7 is really out of the question. Assuming somebody would 
implement (which might not happen in the next three years or so), it can only 
go into 3.x, so you'ld have to port your code to 3.x to use it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8792
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8792] xmlrpclib compatibility issues with Apache XML-RPC library

2010-07-23 Thread Bhargav

Bhargav bhar...@bluejeansnet.com added the comment:

I am seeing the same exception when the server returns ex:nil, even when I 
enable allow_none.

The library only accepts 'nil' not 'ex:nil'

As a workaround, I have added dispatch[ex:nil] to my local library (which is 
obviously not a solution)

--
nosy: +bhargav

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8792
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9006] xml-rpc Server object does not propagate the encoding to Unmarshaller

2010-06-16 Thread Timothée CEZARD

New submission from Timothée CEZARD tim.cez...@gmail.com:

xmlrpc cleint  (Server class) default encoding is utf-8 it can be modified 
through the encoding keyword parameter. This parameter is not passed to the 
Unmarshaller that decode the bit flow causing the server to crash
attached is two script reproducing the issue

--
components: XML
files: xmlrpc_bug.tar.gz
messages: 107910
nosy: Timothée.CEZARD
priority: normal
severity: normal
status: open
title: xml-rpc Server object does not propagate the encoding to Unmarshaller
type: crash
versions: Python 2.6
Added file: http://bugs.python.org/file17682/xmlrpc_bug.tar.gz

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9006
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9006] xml-rpc Server object does not propagate the encoding to Unmarshaller

2010-06-16 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Thank your for reporting this bug. Are you able to reproduce the bug with 
current development versions, a.k.a. 2.7 (svn trunk, or the rc release) and 3.2 
(py3k branch)? Only security and documentation fixes go in stable releases like 
2.6 and 3.1. Also, please upload separate files instead of archives, it’s 
easier for review. Thanks again!

--
nosy: +merwok

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9006
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



xml-rpc UnicodeDecodeError

2010-06-10 Thread timothee cezard

Hi all,
I'm starting to use xml-rpc module to check and potentially modify a 
confluence wiki

but I'm getting and error on a page containing the pound (£) sign

here is the code I'm using

server = xmlrpclib.ServerProxy('my_server',  verbose=True)
token = server.confluence1.login('username','password)
page = server.confluence1.getPage(token, spacekey, pagetitle)
print page['content']
I'm getting:
   page = server.confluence1.getPage(token, spacekey, pagetitle)
  File /usr/lib/python2.6/xmlrpclib.py, line 1199, in __call__
return self.__send(self.__name, args)
  File /usr/lib/python2.6/xmlrpclib.py, line 1489, in __request
verbose=self.__verbose
  File /usr/lib/python2.6/xmlrpclib.py, line 1253, in request
return self._parse_response(h.getfile(), sock)
  File /usr/lib/python2.6/xmlrpclib.py, line 1387, in _parse_response
p.feed(response)
  File /usr/lib/python2.6/xmlrpclib.py, line 868, in end
return f(self, join(self._data, ))
  File /usr/lib/python2.6/xmlrpclib.py, line 959, in end_value
self.end_string(data)
  File /usr/lib/python2.6/xmlrpclib.py, line 916, in end_string
data = _decode(data, self._encoding)
  File /usr/lib/python2.6/xmlrpclib.py, line 164, in _decode
data = unicode(data, encoding)
  UnicodeDecodeError: 'utf8' codec can't decode byte 0xa3 in position 
811: unexpected code byte



I tried changing the encoding to iso-8859-1
server = xmlrpclib.ServerProxy('my_server', encoding='iso-8859-1', 
verbose=True)

token = server.confluence1.login('username','password)
page = server.confluence1.getPage(token, spacekey, pagetitle)
print page['content']
I'm getting the same exception

Does any of you have an idea of what I'm doing wrong?
I'm using Python 2.6.4 (r264:75706, Dec  7 2009, 18:43:55) and xmlrpclib 
version 1.0.1


Thanks

Tim


--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

--
http://mail.python.org/mailman/listinfo/python-list


[issue8875] XML-RPC improvement is described twice.

2010-06-07 Thread A.M. Kuchling

A.M. Kuchling li...@amk.ca added the comment:

Fixed in rev81801.  Thanks for your report!

--
resolution:  - fixed
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8875
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8875] XML-RPC improvement is described twice.

2010-06-01 Thread INADA Naoki

New submission from INADA Naoki songofaca...@gmail.com:

http://docs.python.org/dev/whatsnew/2.7.html#new-and-improved-modules

The XML-RPC client and server, provided by... appears twice.

--
assignee: d...@python
components: Documentation
messages: 106875
nosy: d...@python, naoki
priority: normal
severity: normal
status: open
title: XML-RPC improvement is described twice.
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8875
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8875] XML-RPC improvement is described twice.

2010-06-01 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
nosy: +akuchling, ezio.melotti
stage:  - needs patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8875
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8792] xmlrpclib compatibility issues with Apache XML-RPC library

2010-05-29 Thread Brian Quinlan

Brian Quinlan br...@sweetapp.com added the comment:

A few notes:
1. these types are *not* part of the XML-RPC specification, they are Apache 
extensions
2. these types seem designed to accommodate Java
3. some of these types would be very possible to accommodate e.g. 
ex:serializable which contains a serialized Java object

--
nosy: +bquinlan

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8792
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8190] Add a PyPI XML-RPC client module

2010-05-26 Thread Alexis Metaireau

Changes by Alexis Metaireau ametair...@gmail.com:


--
nosy: +alexis

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8190
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8792] xmlrpclib compatibility issues with Apache XML-RPC library

2010-05-23 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +loewis
versions: +Python 2.7, Python 3.1, Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8792
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8792] xmlrpclib compatibility issues with Apache XML-RPC library

2010-05-22 Thread Attila Nagy

New submission from Attila Nagy b...@fsn.hu:

When talking to an Apache XML-RPC library based application via python 2.6.5 
xmlrpclib, I get this exception:
Traceback (most recent call last):
  File prb.py, line 4, in module
proxy.catv.getEndpointIdByIp('1.1.1.1')
  File /tmp/Python-2.6.5/Lib/xmlrpclib.py, line 1199, in __call__
return self.__send(self.__name, args)
  File /tmp/Python-2.6.5/Lib/xmlrpclib.py, line 1491, in __request
verbose=self.__verbose
  File /tmp/Python-2.6.5/Lib/xmlrpclib.py, line 1253, in request
return self._parse_response(h.getfile(), sock)
  File /tmp/Python-2.6.5/Lib/xmlrpclib.py, line 1389, in _parse_response
p.feed(response)
  File /tmp/Python-2.6.5/Lib/xmlrpclib.py, line 601, in feed
self._parser.Parse(data, 0)
  File /tmp/Python-2.6.5/Lib/xmlrpclib.py, line 868, in end
return f(self, join(self._data, ))
  File /tmp/Python-2.6.5/Lib/xmlrpclib.py, line 935, in end_struct
dict[_stringify(items[i])] = items[i+1]
IndexError: list index out of range

The exception is caused by the XML response, which includes a value with 
ex:i8 type. According to this: http://ws.apache.org/xmlrpc/types.html, there 
are a lot more types, which are not understood by python's xmlrpclib.

It's easy to fix the above by adding ex:i8 to the list of end_int dispatcher:
def end_int(self, data):
self.append(int(data))
self._value = 0
dispatch[i4] = end_int
dispatch[i8] = end_int
dispatch[ex:i8] = end_int
dispatch[int] = end_int

This makes the error disappear (and the program to work).
Of course, it would be nice to support all other types as well (in both 
directions).

--
components: XML
messages: 106322
nosy: bra
priority: normal
severity: normal
status: open
title: xmlrpclib compatibility issues with Apache XML-RPC library
type: behavior
versions: Python 2.6

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8792
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8190] Add a PyPI XML-RPC client module

2010-04-20 Thread Alexandre Conrad

Changes by Alexandre Conrad alexandre.con...@gmail.com:


--
nosy: +aconrad

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8190
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: xml-rpc

2010-03-29 Thread Brian Quinlan


On Mar 14, 2010, at 12:14 AM, ahmet erdinc yilmaz wrote:


Hello,

Recenetly we are developing a senior project and decide to use  
xmlrpclib.
However I have some questions. In the documentation I could not find  
any clue about
handling requests? Does the server handles each request in a  
separate thread? Or is

there some queuing mechanism for client calls? Thanks in advance.


By default calls are processed serially. Look for ThreadingMixIn in:
http://docs.python.org/library/socketserver.html

And maybe read this too:
http://code.activestate.com/recipes/81549-a-simple-xml-rpc-server/

Cheers,
Brian




--erdinc
--
http://mail.python.org/mailman/listinfo/python-list


--
http://mail.python.org/mailman/listinfo/python-list


[issue8190] Add a PyPI XML-RPC client module

2010-03-29 Thread Zubin Mithra

Changes by Zubin Mithra zubin.mit...@gmail.com:


--
nosy: +zubin71

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8190
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8190] Add an xml-rpc client for PyPi

2010-03-28 Thread Shashwat Anand

Changes by Shashwat Anand anand.shash...@gmail.com:


--
nosy: +l0nwlf

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8190
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8190] Add an xml-rpc client for PyPi

2010-03-28 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Hello

XML-RPC is a legacy protocol that works against the Web, i.e. it does not 
respect and benefit from the Web architecture. Why not going the REST way?

Regards

--
nosy: +merwok

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8190
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8190] Add an xml-rpc client for PyPi

2010-03-28 Thread Tarek Ziadé

Tarek Ziadé ziade.ta...@gmail.com added the comment:

We want to add a PyPI client in Distutils2, and PyPI provides these information 
via XML-RPC.

PyPI could probably have a REST interface to grab these info as well, but this 
is another topic/project.

On our side (distutils2), we want to provide a nice set of APIs to get some 
info PyPI has, and the fact that it's via XML-RPC is an implementation detail: 
if PyPI switch to something else, this should just impact the internals of the 
client, and not change our APIs.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8190
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8190] Add a PyPI XML-RPC client module

2010-03-28 Thread Tarek Ziadé

Tarek Ziadé ziade.ta...@gmail.com added the comment:

Please don't. This is confusing because some commands already interact with 
PyPI (upload/register).

I don't see the problem in mentioning XML-RPC in the title here. It makes what 
we need to do crystal clear.

--
title: Add a PyPI client module - Add a PyPI XML-RPC client module

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8190
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8190] Add a PyPI XML-RPC client module

2010-03-28 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

You‘re right, sorry for the noise.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8190
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8190] Add an xml-rpc client for PyPi

2010-03-20 Thread Tarek Ziadé

New submission from Tarek Ziadé ziade.ta...@gmail.com:

let's add a small xml-rpc client in Distutils2, implementing all functions.

See http://wiki.python.org/moin/PyPiXmlRpc

--
assignee: tarek
components: Distutils2
messages: 101414
nosy: tarek
priority: normal
severity: normal
stage: needs patch
status: open
title: Add an xml-rpc client for PyPi
type: feature request

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8190
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8190] Add an xml-rpc client for PyPi

2010-03-20 Thread Tarek Ziadé

Tarek Ziadé ziade.ta...@gmail.com added the comment:

see also http://tools.assembla.com/yolk/browser/trunk/yolk/pypi.py

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8190
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: xml-rpc

2010-03-16 Thread Gabriel Genellina
En Sun, 14 Mar 2010 05:14:49 -0300, ahmet erdinc yilmaz  
ahmeterdin...@gmail.com escribió:



Recenetly we are developing a senior project and decide to use xmlrpclib.
However I have some questions. In the documentation I could not find any  
clue about
handling requests? Does the server handles each request in a separate  
thread? Or is

there some queuing mechanism for client calls? Thanks in advance.


xmlrpclib is a *client* library.
Python also provides an XMLRPC *server* in the SimpleXMLRPCServer module.  
It inherits from SocketServer.TCPServer. The default behavior is to  
process one request at a time, in a single process. You may alter such  
behavior by additionally inheriting from ForkingMixIn or ThreadingMixIn.


--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list


xml-rpc

2010-03-14 Thread ahmet erdinc yilmaz

Hello,

Recenetly we are developing a senior project and decide to use xmlrpclib.
However I have some questions. In the documentation I could not find any 
clue about
handling requests? Does the server handles each request in a separate 
thread? Or is

there some queuing mechanism for client calls? Thanks in advance.


--erdinc
--
http://mail.python.org/mailman/listinfo/python-list


Re: xml-rpc

2010-03-14 Thread Martin P. Hellwig

On 03/14/10 08:14, ahmet erdinc yilmaz wrote:

Hello,

Recenetly we are developing a senior project and decide to use xmlrpclib.
However I have some questions. In the documentation I could not find any
clue about
handling requests? Does the server handles each request in a separate
thread? Or is
there some queuing mechanism for client calls? Thanks in advance.


--erdinc


How I usually tackle stuff like this:
[mar...@aspire8930 /usr/home/martin]$ python
Python 2.6.4 (r264:75706, Jan 31 2010, 20:52:16)
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd8
Type help, copyright, credits or license for more information.
 import SimpleXMLRPCServer
 help(SimpleXMLRPCServer)
read it and somewhere at CLASSES it says
CLASSES

BaseHTTPServer.BaseHTTPRequestHandler(SocketServer.StreamRequestHandler)
SimpleXMLRPCRequestHandler
SimpleXMLRPCDispatcher
CGIXMLRPCRequestHandler
SimpleXMLRPCServer(SocketServer.TCPServer, SimpleXMLRPCDispatcher)
SocketServer.TCPServer(SocketServer.BaseServer)
SimpleXMLRPCServer(SocketServer.TCPServer, SimpleXMLRPCDispatcher)

Aah so it is based on SocketServer, lets have a look at that:

 import SocketServer
 help(SocketServer)
Help on module SocketServer:
reading it and then it says

There are five classes in an inheritance diagram, four of which 
represent

synchronous servers of four types:

++
| BaseServer |
++
  |
  v
+---++--+
| TCPServer |---| UnixStreamServer |
+---++--+
  |
  v
+---+++
| UDPServer |---| UnixDatagramServer |
+---+++

So the base of all these servers is BaseServer, hmm somebody must have a 
laugh right now :-)


Okay lets have a look at that then:

 import BaseServer
Traceback (most recent call last):
  File stdin, line 1, in module
ImportError: No module named BaseServer

Hmmm okay, lets have a look at the SocketServer source itself then, but 
where is it?

 SocketServer.__file__
'/usr/local/lib/python2.6/SocketServer.pyc'

I bet that the non compiled file is in the same directory, let's have a 
look at it with less.


 quit()
[mar...@aspire8930 /usr/home/martin]$ less 
/usr/local/lib/python2.6/SocketServer.py


And there it says among other interesting stuff:

# The distinction between handling, getting, processing and
# finishing a request is fairly arbitrary.  Remember:
#
# - handle_request() is the top-level call.  It calls
#   select, get_request(), verify_request() and process_request()
# - get_request() is different for stream or datagram sockets
# - process_request() is the place that may fork a new process
#   or create a new thread to finish the request
# - finish_request() instantiates the request handler class;
#   this constructor will handle the request all by itself

def handle_request(self):
Handle one request, possibly blocking.

Respects self.timeout.

# Support people who used socket.settimeout() to escape
# handle_request before self.timeout was available.
timeout = self.socket.gettimeout()
if timeout is None:
timeout = self.timeout
elif self.timeout is not None:
timeout = min(timeout, self.timeout)
fd_sets = select.select([self], [], [], timeout)
if not fd_sets[0]:
self.handle_timeout()
return
self._handle_request_noblock()

def _handle_request_noblock(self):
Handle one request, without blocking.

I assume that select.select has returned that the socket is
readable before this function was called, so there should be
no risk of blocking in get_request().

try:
request, client_address = self.get_request()
except socket.error:
return
if self.verify_request(request, client_address):
try:
self.process_request(request, client_address)
except:
self.handle_error(request, client_address)
self.close_request(request)


I leave the remaining parts of your question as an exercise :-)

--
mph
--
http://mail.python.org/mailman/listinfo/python-list


Re: xml-rpc

2010-03-14 Thread hackingKK

Instead of using the library directly,
isn't python-twisted a better choice?

happy hacking.
Krishnakant.

On Sunday 14 March 2010 03:47 PM, Martin P. Hellwig wrote:

On 03/14/10 08:14, ahmet erdinc yilmaz wrote:

Hello,

Recenetly we are developing a senior project and decide to use 
xmlrpclib.

However I have some questions. In the documentation I could not find any
clue about
handling requests? Does the server handles each request in a separate
thread? Or is
there some queuing mechanism for client calls? Thanks in advance.


--erdinc


How I usually tackle stuff like this:
[mar...@aspire8930 /usr/home/martin]$ python
Python 2.6.4 (r264:75706, Jan 31 2010, 20:52:16)
[GCC 4.2.1 20070719  [FreeBSD]] on freebsd8
Type help, copyright, credits or license for more information.
 import SimpleXMLRPCServer
 help(SimpleXMLRPCServer)
read it and somewhere at CLASSES it says
CLASSES

BaseHTTPServer.BaseHTTPRequestHandler(SocketServer.StreamRequestHandler)
SimpleXMLRPCRequestHandler
SimpleXMLRPCDispatcher
CGIXMLRPCRequestHandler
SimpleXMLRPCServer(SocketServer.TCPServer, 
SimpleXMLRPCDispatcher)

SocketServer.TCPServer(SocketServer.BaseServer)
SimpleXMLRPCServer(SocketServer.TCPServer, 
SimpleXMLRPCDispatcher)


Aah so it is based on SocketServer, lets have a look at that:

 import SocketServer
 help(SocketServer)
Help on module SocketServer:
reading it and then it says

There are five classes in an inheritance diagram, four of which 
represent

synchronous servers of four types:

++
| BaseServer |
++
  |
  v
+---++--+
| TCPServer |---| UnixStreamServer |
+---++--+
  |
  v
+---+++
| UDPServer |---| UnixDatagramServer |
+---+++

So the base of all these servers is BaseServer, hmm somebody must have 
a laugh right now :-)


Okay lets have a look at that then:

 import BaseServer
Traceback (most recent call last):
  File stdin, line 1, in module
ImportError: No module named BaseServer

Hmmm okay, lets have a look at the SocketServer source itself then, 
but where is it?

 SocketServer.__file__
'/usr/local/lib/python2.6/SocketServer.pyc'

I bet that the non compiled file is in the same directory, let's have 
a look at it with less.


 quit()
[mar...@aspire8930 /usr/home/martin]$ less 
/usr/local/lib/python2.6/SocketServer.py


And there it says among other interesting stuff:

# The distinction between handling, getting, processing and
# finishing a request is fairly arbitrary.  Remember:
#
# - handle_request() is the top-level call.  It calls
#   select, get_request(), verify_request() and process_request()
# - get_request() is different for stream or datagram sockets
# - process_request() is the place that may fork a new process
#   or create a new thread to finish the request
# - finish_request() instantiates the request handler class;
#   this constructor will handle the request all by itself

def handle_request(self):
Handle one request, possibly blocking.

Respects self.timeout.

# Support people who used socket.settimeout() to escape
# handle_request before self.timeout was available.
timeout = self.socket.gettimeout()
if timeout is None:
timeout = self.timeout
elif self.timeout is not None:
timeout = min(timeout, self.timeout)
fd_sets = select.select([self], [], [], timeout)
if not fd_sets[0]:
self.handle_timeout()
return
self._handle_request_noblock()

def _handle_request_noblock(self):
Handle one request, without blocking.

I assume that select.select has returned that the socket is
readable before this function was called, so there should be
no risk of blocking in get_request().

try:
request, client_address = self.get_request()
except socket.error:
return
if self.verify_request(request, client_address):
try:
self.process_request(request, client_address)
except:
self.handle_error(request, client_address)
self.close_request(request)


I leave the remaining parts of your question as an exercise :-)



--
http://mail.python.org/mailman/listinfo/python-list


Re: xml-rpc

2010-03-14 Thread Martin P. Hellwig

On 03/14/10 10:32, hackingKK wrote:

Instead of using the library directly,
isn't python-twisted a better choice?

cut
Why?

--
mph
--
http://mail.python.org/mailman/listinfo/python-list


Re: XML-RPC(using SimpleXMLRPCServer) slow on the first call

2009-10-14 Thread Mahi Haile
-- Forwarded message --
 From: Gabriel Genellina gagsl-...@yahoo.com.ar
 To: python-list@python.org
 Date: Wed, 14 Oct 2009 00:52:13 -0300
 Subject: Re: XML-RPC(using SimpleXMLRPCServer) slow on the first call
 En Mon, 12 Oct 2009 18:58:45 -0300, Mahi Haile begin.middle@gmail.com
 escribió:

  Hello all,I have an xml-rpc server running on a machine in the same LAN as
 the client. Both the server and the client are in Python.

 When I have a series of xmlrepc calls from the client to the server, the
 first call usually takes much longer than it should - orders of magnitude.
 The latency is usually sub-10ms on the other calls, but the first call
 takes
 up to 10 seconds or so. This are very simple functions, with almost no
 computation.

 Do you have any ideas?


 I doubt this is a Python problem. I'd look into the network: DNS
 resolution, IPv6 (Windows XP has some timeout issues with IPv6 enabled).

 --
 Gabriel Genellina

 That seems to be correct. The machine is behind a NAT, so that is probably
why. Thank you.
-- 
http://mail.python.org/mailman/listinfo/python-list


  1   2   3   >