This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: I found Python 3.1 xmlrpc lib use "" not properly. and i have fixed it.
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.1, Python 3.2
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Jelly.Chen, amaury.forgeotdarc, flox, mark.dickinson
Priority: normal Keywords: patch

Created on 2010-02-21 17:56 by Jelly.Chen, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
xmlrpc.client.modify.rar Jelly.Chen, 2010-02-21 17:56 client.py is ok, client_old.py is wrong.
xmlrpc.patch Jelly.Chen, 2010-02-22 11:31
wrong.xml Jelly.Chen, 2010-02-22 11:31
right.xml Jelly.Chen, 2010-02-22 11:31
issue7977_test_xmlrpc_.log flox, 2010-02-22 15:59 python -m test.regrtest -v test_xmlrpc
unnamed Jelly.Chen, 2010-03-20 12:10
dir.patch Jelly.Chen, 2010-03-20 12:10
Messages (9)
msg99673 - (view) Author: Jelly Chen (Jelly.Chen) Date: 2010-02-21 17:56
i found Python 3.1 xmlrpc lib use "<param>" not properly. and i have fixed it.
please have a look at the attachment

wrong.txt is the output of client_old.py, it use <param> not properly.
right.txt is the output of client.py, it use <param> properly.
msg99674 - (view) Author: Mark Dickinson (mark.dickinson) * (Python committer) Date: 2010-02-21 18:40
Please could you generate and upload a patch against the Python source?  (For Windows, you can do this using the WinMerge tool, amongst others.)  I'm unable to open the file you attached on my machine:

"""No application knows how to open ... xmlrpc.client.modify.rar."""

If you could explain how "<param>" is being used improperly, that might also help.
msg99722 - (view) Author: Jelly Chen (Jelly.Chen) Date: 2010-02-22 11:31
I can't modify the issue. so i replay this email.
The old xmlrpc lib don't use <param> surround a param. please take a look at
wrong.xml and right.xml.

2010/2/22 Mark Dickinson <report@bugs.python.org>

>
> Mark Dickinson <dickinsm@gmail.com> added the comment:
>
> Please could you generate and upload a patch against the Python source?
>  (For Windows, you can do this using the WinMerge tool, amongst others.)
>  I'm unable to open the file you attached on my machine:
>
> """No application knows how to open ... xmlrpc.client.modify.rar."""
>
> If you could explain how "<param>" is being used improperly, that might
> also help.
>
> ----------
> nosy: +mark.dickinson
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue7977>
> _______________________________________
>
msg99733 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-02-22 13:39
The patch causes failures in test_xmlrpc, using Py3k branch.
msg99736 - (view) Author: Jelly Chen (Jelly.Chen) Date: 2010-02-22 14:19
Can i have a look at the failure tests?
I just check out code at http://svn.python.org/projects/python/branches/py3k
It's very slow. and i'm afraid that i don't know how to run the tests.

The <param> tag use improperly is very clear.

the wrong case: very ugly, there is no difference between <param> and
<params>.
<params>
<param>
<value><data>
<value><int>1</int></value>
<value><string>sinojelly</string></value>
<value><string>123456</string></value>
<value><struct>
<member>
<name>description</name>
<value><string>Test description4</string></value>
</member>
<member>
<name>title</name>
<value><string>Test article3</string></value>
</member>
</struct></value>
<value><boolean>1</boolean></value>
</data></value>
</param>
</params>

the right one: there is a <param> around every parameter.
 <params>
  <param>
   <value>
    <string>479153</string>
   </value>
  </param>
  <param>
   <value>
    <string>sinojelly</string>
   </value>
  </param>
  <param>
   <value>
    <string>123456</string>
   </value>
  </param>
  <param>
   <value>
    <struct>
     <member>
      <name>title</name>
      <value>
       <string>Just Test.</string>
      </value>
     </member>
     <member>
      <name>description</name>
      <value>
       <string>&lt;p&gt;Just Test wlw post.&lt;/p&gt;</string>
      </value>
     </member>
     <member>
      <name>categories</name>
      <value>
       <array>
        <data />
       </array>
      </value>
     </member>
    </struct>
   </value>
  </param>
  <param>
   <value>
    <boolean>1</boolean>
   </value>
  </param>
 </params>

2010/2/22 Florent Xicluna <report@bugs.python.org>

>
> Florent Xicluna <laxyf@yahoo.fr> added the comment:
>
> The patch causes failures in test_xmlrpc, using Py3k branch.
>
> ----------
> nosy: +flox
> priority:  -> normal
> stage:  -> test needed
> versions: +Python 3.2
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue7977>
> _______________________________________
>
msg99756 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-02-22 15:54
I didn't look at this issue in details.
I'm not a specialist of xmlrpc. But it is unlikely that the patch will be accepted, if it fails the regression tests.

Could you investigate this failure and provide a patch which fixes the tests? You could add a specific test related to this issue, too.

Command to run the tests (on linux):
        python -m test.regrtest test_xmlrpc
 
I've tested with 3.1 branch, and test_xmlrpc fails too.
msg99762 - (view) Author: Florent Xicluna (flox) * (Python committer) Date: 2010-02-22 15:59
Attached, the output of the test with "-v test_xmlrpc".
msg101371 - (view) Author: Jelly Chen (Jelly.Chen) Date: 2010-03-20 12:10
I know why those two tests run failed, and I found another way to solve the
problem, do not make the existing tests broken, and at the same time I have
added another test case.
I encountered this problem due to a argument is already being a tuple but
re-packaged into another tuple, It appears a high probability. Maybe modify
the client.py according to this patch is a solution.

2010/2/22 Florent Xicluna <report@bugs.python.org>

>
> Florent Xicluna <laxyf@yahoo.fr> added the comment:
>
> Attached, the output of the test with "-v test_xmlrpc".
>
> ----------
> Added file: http://bugs.python.org/file16308/issue7977_test_xmlrpc.log
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue7977>
> _______________________________________
>
msg111151 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2010-07-22 06:22
But what if I want to pass a tuple through xmlrpc?
The function in the test case:
+        def execute(server, methodname, *args):
+            r = getattr(server, methodname)(args) # params become a tuple
+            return r
looks wrong to me. It has the effect to modify the nature of the arguments. 
If I write instead:
+        def execute(server, methodname, *args):
+            r = getattr(server, methodname)(*args)
+            return r
(note the additional '*') the function may receive several arguments, and will call the server method with several arguments as well.
Tuple unpacking occurs where tuple packing was made. The library does not need to be changed.
History
Date User Action Args
2022-04-11 14:56:57adminsetgithub: 52225
2010-08-08 22:16:27floxsetstatus: pending -> closed
stage: test needed -> resolved
2010-07-22 06:22:25amaury.forgeotdarcsetstatus: open -> pending

nosy: + amaury.forgeotdarc
messages: + msg111151

resolution: not a bug
2010-03-20 12:10:30Jelly.Chensetfiles: + unnamed, dir.patch

messages: + msg101371
2010-02-22 15:59:27floxsetfiles: + issue7977_test_xmlrpc_.log

messages: + msg99762
2010-02-22 15:55:17floxsetfiles: - unnamed
2010-02-22 15:54:26floxsetmessages: + msg99756
2010-02-22 14:19:14Jelly.Chensetfiles: + unnamed

messages: + msg99736
2010-02-22 13:39:02floxsetpriority: normal
versions: + Python 3.2
nosy: + flox

messages: + msg99733

stage: test needed
2010-02-22 13:18:38floxsetfiles: - unnamed
2010-02-22 11:31:42Jelly.Chensetfiles: + unnamed, xmlrpc.patch, wrong.xml, right.xml
keywords: + patch
messages: + msg99722
2010-02-21 18:40:05mark.dickinsonsetnosy: + mark.dickinson
messages: + msg99674
2010-02-21 17:56:18Jelly.Chencreate