Jelly Chen <sinoje...@gmail.com> added the comment:

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 <rep...@bugs.python.org>

>
> Mark Dickinson <dicki...@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 <rep...@bugs.python.org>
> <http://bugs.python.org/issue7977>
> _______________________________________
>

----------
keywords: +patch
Added file: http://bugs.python.org/file16292/unnamed
Added file: http://bugs.python.org/file16293/xmlrpc.patch
Added file: http://bugs.python.org/file16294/wrong.xml
Added file: http://bugs.python.org/file16295/right.xml

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7977>
_______________________________________
I can&#39;t modify the issue. so i replay this email.<div>The old xmlrpc lib 
don&#39;t use &lt;param&gt;&nbsp;surround a param. please take a look at 
wrong.xml and right.xml.<br><br><div class="gmail_quote">2010/2/22 Mark 
Dickinson <span dir="ltr">&lt;<a 
href="mailto:rep...@bugs.python.org";>rep...@bugs.python.org</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc 
solid;padding-left:1ex;"><br>
Mark Dickinson &lt;<a 
href="mailto:dicki...@gmail.com";>dicki...@gmail.com</a>&gt; added the 
comment:<br>
<br>
Please could you generate and upload a patch against the Python source? 
&nbsp;(For Windows, you can do this using the WinMerge tool, amongst others.) 
&nbsp;I&#39;m unable to open the file you attached on my machine:<br>
<br>
&quot;&quot;&quot;No application knows how to open ... 
xmlrpc.client.modify.rar.&quot;&quot;&quot;<br>
<br>
If you could explain how &quot;&lt;param&gt;&quot; is being used improperly, 
that might also help.<br>
<br>
----------<br>
nosy: +mark.dickinson<br>
<div><div></div><div class="h5"><br>
_______________________________________<br>
Python tracker &lt;<a 
href="mailto:rep...@bugs.python.org";>rep...@bugs.python.org</a>&gt;<br>
&lt;<a href="http://bugs.python.org/issue7977"; 
target="_blank">http://bugs.python.org/issue7977</a>&gt;<br>
_______________________________________<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Contact me: 
&nbsp;<br>QQ: 2578717<br>MSN: <a 
href="mailto:sinoje...@msn.cn";>sinoje...@msn.cn</a><br>新浪微博:<a 
href="http://t.sina.com.cn/sinojelly";>http://t.sina.com.cn/sinojelly</a><br>
我的博客:<a 
href="http://sinojelly.20x.cc";>http://sinojelly.20x.cc</a><br><br><br>
</div>
diff -Nur xmlrpc\client.py modify\xmlrpc\client.py
--- xmlrpc\client.py    Thu Jun 04 17:11:52 2009
+++ modify\xmlrpc\client.py     Mon Feb 22 19:13:37 2010
@@ -49,6 +49,7 @@
 # 2003-07-12 gp  Correct marshalling of Faults
 # 2003-10-31 mvl Add multicall support
 # 2004-08-20 mvl Bump minimum supported Python version to 2.1
+# 2010-02-22 cgd Reorganize xmlrpc request message format (Chenguodong 
email:sinoje...@gmail.com)
 #
 # Copyright (c) 1999-2002 by Secret Labs AB.
 # Copyright (c) 1999-2002 by Fredrik Lundh.
@@ -508,9 +509,7 @@
             # is for now.  See @XMLRPC3 for more information. /F
             write("<params>\n")
             for v in values:
-                write("<param>\n")
                 dump(v, write)
-                write("</param>\n")
             write("</params>\n")
         result = "".join(out)
         return result
@@ -588,13 +587,25 @@
             raise TypeError("cannot marshal recursive sequences")
         self.memo[i] = None
         dump = self.__dump
+        for v in value:
+            write("<param>\n")
+            dump(v, write)
+            write("</param>\n")
+        del self.memo[i]
+    dispatch[tuple] = dump_array
+
+    def dump_list(self, value, write):
+        i = id(value)
+        if i in self.memo:
+            raise TypeError("cannot marshal recursive sequences")
+        self.memo[i] = None
+        dump = self.__dump
         write("<value><array><data>\n")
         for v in value:
             dump(v, write)
         write("</data></array></value>\n")
         del self.memo[i]
-    dispatch[tuple] = dump_array
-    dispatch[list] = dump_array
+    dispatch[list] = dump_list
 
     def dump_struct(self, value, write, escape=escape):
         i = id(value)
<?xml version='1.0'?>
<methodCall>
<methodName>metaWeblog.newPost</methodName>
<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>
</methodCall>
<?xml version="1.0" encoding="gb2312"?>
<methodCall>
 <methodName>metaWeblog.newPost</methodName>
 <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>
</methodCall>
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to