[issue7977] I found Python 3.1 xmlrpc lib use "" not properly. and i have fixed it.

2010-02-22 Thread Jelly Chen

Jelly Chen  added the comment:

I can't modify the issue. so i replay this email.
The old xmlrpc lib don't use  surround a param. please take a look at
wrong.xml and right.xml.

2010/2/22 Mark Dickinson 

>
> Mark Dickinson  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 "" is being used improperly, that might
> also help.
>
> --
> nosy: +mark.dickinson
>
> ___
> Python tracker 
> <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 
<http://bugs.python.org/issue7977>
___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 <mailto:rep...@bugs.python.org";>rep...@bugs.python.org>

Mark Dickinson <mailto:dicki...@gmail.com";>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 <mailto:rep...@bugs.python.org";>rep...@bugs.python.org>
<http://bugs.python.org/issue7977"; 
target="_blank">http://bugs.python.org/issue7977>
___
-- Contact me: 
 QQ: 2578717MSN: mailto:sinoje...@msn.cn";>sinoje...@msn.cn新浪微博:http://t.sina.com.cn/sinojelly";>http://t.sina.com.cn/sinojelly
我的博客:http://sinojelly.20x.cc";>http://sinojelly.20x.cc

diff -Nur xmlrpc\client.py modify\xmlrpc\client.py
--- xmlrpc\client.pyThu 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("\n")
 for v in values:
-write("\n")
 dump(v, write)
-write("\n")
 write("\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("\n")
+dump(v, write)
+write("\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("\n")
 for v in value:
 dump(v, write)
 write("\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)


metaWeblog.newPost



1
sinojelly
123456


description
Test description4


title
Test article3


1






 metaWeblog.newPost
 
  
   
479153
   
  
  
   
sinojelly
   
  
  
   
123456
   
  
  
   

 
  title
  
   Just Test.
  
 
 
  description
  
   <p>Just Test wlw post.</p>
  
 
 
  categories
  
   

   
  
 

   
  
  
   
1
   
  
 

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



[issue7977] I found Python 3.1 xmlrpc lib use "" not properly. and i have fixed it.

2010-02-22 Thread Jelly Chen

Jelly Chen  added the comment:

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  tag use improperly is very clear.

the wrong case: very ugly, there is no difference between  and
.



1
sinojelly
123456


description
Test description4


title
Test article3


1




the right one: there is a  around every parameter.
 
  
   
479153
   
  
  
   
sinojelly
   
  
  
   
123456
   
  
  
   

 
  title
  
   Just Test.
  
 
 
  description
  
   <p>Just Test wlw post.</p>
  
 
 
  categories
  
   

   
  
 

   
  
  
   
1
   
  
 

2010/2/22 Florent Xicluna 

>
> Florent Xicluna  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 
> <http://bugs.python.org/issue7977>
> ___
>

--
Added file: http://bugs.python.org/file16303/unnamed

___
Python tracker 
<http://bugs.python.org/issue7977>
___Can i have a look at the failure tests?I just check out code 
at http://svn.python.org/projects/python/branches/py3k"; style="color: rgb(0, 
0, 170); text-decoration: none; 
">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 <mailto:rep...@bugs.python.org";>rep...@bugs.python.org>

Florent Xicluna <mailto:la...@yahoo.fr";>la...@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 <mailto:rep...@bugs.python.org";>rep...@bugs.python.org>
<http://bugs.python.org/issue7977"; 
target="_blank">http://bugs.python.org/issue7977>
___
-- Contact me: 
 QQ: 2578717MSN: mailto:sinoje...@msn.cn";>sinoje...@msn.cn新浪微博:http://t.sina.com.cn/sinojelly";>http://t.sina.com.cn/sinojelly
我的博客:http://sinojelly.20x.cc";>http://sinojelly.20x.cc

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



[issue7986] Python 3 cannot recognize url like: https://sinojellycn:123...@storage.msn.com

2010-02-22 Thread Jelly Chen

New submission from Jelly Chen :

posturl='https://sinojellycn:123...@storage.msn.com/storageservice/MetaWeblog.rpc'
username="sinojellycn"
password="123456"

blog = pyblog.WordPress(posturl, username, password)
content = {"description":'Test description6', "title":'Test article6'}
blog.new_post(content, blogid = "1") 

>>> 
Traceback (most recent call last):
  File "C:\Python31\Lib\http\client.py", line 664, in _set_hostport
port = int(host[i+1:])
ValueError: invalid literal for int() with base 10: '123...@storage.msn.com'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 248, in run_nodebug
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\BlogPost.py", line 
384, in 
blog = pyblog.WordPress(posturl, username, password)
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\pyblog.py", line 266, 
in __init__
MetaWeblog.__init__(self, serverapi, username, password, encoding)
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\pyblog.py", line 167, 
in __init__
Blog.__init__(self, serverapi, username, password, encoding, appkey)
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\pyblog.py", line 57, 
in __init__
if not checkURL(serverapi):
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\pyblog.py", line 19, 
in checkURL
try: urllib.request.urlopen(url)
  File "C:\Python31\Lib\urllib\request.py", line 119, in urlopen
return _opener.open(url, data, timeout)
  File "C:\Python31\Lib\urllib\request.py", line 347, in open
response = self._open(req, data)
  File "C:\Python31\Lib\urllib\request.py", line 365, in _open
'_open', req)
  File "C:\Python31\Lib\urllib\request.py", line 325, in _call_chain
result = func(*args)
  File "C:\Python31\Lib\urllib\request.py", line 1080, in https_open
return self.do_open(http.client.HTTPSConnection, req)
  File "C:\Python31\Lib\urllib\request.py", line 1034, in do_open
h = http_class(host, timeout=req.timeout) # will parse host:port
  File "C:\Python31\Lib\http\client.py", line 1027, in __init__
HTTPConnection.__init__(self, host, port, strict, timeout)
  File "C:\Python31\Lib\http\client.py", line 650, in __init__
self._set_hostport(host, port)
  File "C:\Python31\Lib\http\client.py", line 666, in _set_hostport
raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
http.client.InvalidURL: nonnumeric port: '123...@storage.msn.com'
>>>

--
components: Library (Lib)
messages: 99760
nosy: Jelly.Chen
severity: normal
status: open
title: Python 3 cannot recognize url like: 
https://sinojellycn:123...@storage.msn.com
type: behavior
versions: Python 3.1

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



[issue7987] Python 3.1's http.client doesn't support HTTPS

2010-02-22 Thread Jelly Chen

New submission from Jelly Chen :

posturl='https://storage.msn.com/storageservice/MetaWeblog.rpc'
username="sinojellycn"
password="123456"

blog = pyblog.WordPress(posturl, username, password)
content = {"description":'Test description6', "title":'Test article6'}
blog.new_post(content, blogid = "1") 

Traceback (most recent call last):
  File "", line 248, in run_nodebug
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\BlogPost.py", line 
385, in 
blog = pyblog.WordPress(posturl, username, password)
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\pyblog.py", line 266, 
in __init__
MetaWeblog.__init__(self, serverapi, username, password, encoding)
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\pyblog.py", line 167, 
in __init__
Blog.__init__(self, serverapi, username, password, encoding, appkey)
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\pyblog.py", line 63, 
in __init__
self.list_methods2()
  File "D:\Users\Documents\My 
Knowledge\Plugins\{A0D025CD-970A-4C62-97E4-5CF6F2C9DD6A}\pyblog.py", line 87, 
in list_methods2
self.methods = self.server.system.listMethods()
  File "C:\Python31\Lib\xmlrpc\client.py", line 1039, in __call__
return self.__send(self.__name, args)
  File "C:\Python31\Lib\xmlrpc\client.py", line 1281, in __request
verbose=self.__verbose
  File "C:\Python31\Lib\xmlrpc\client.py", line 1068, in request
http_conn = self.send_request(host, handler, request_body, verbose)
  File "C:\Python31\Lib\xmlrpc\client.py", line 1193, in send_request
"your version of http.client doesn't support HTTPS")
NotImplementedError: your version of http.client doesn't support HTTPS
>>>

--
components: Library (Lib)
messages: 99765
nosy: Jelly.Chen
severity: normal
status: open
title: Python 3.1's http.client doesn't support HTTPS
type: behavior
versions: Python 3.1

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



[issue7977] I found Python 3.1 xmlrpc lib use "" not properly. and i have fixed it.

2010-03-20 Thread Jelly Chen

Jelly Chen  added the comment:

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 

>
> Florent Xicluna  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 
> <http://bugs.python.org/issue7977>
> ___
>

--
Added file: http://bugs.python.org/file16597/unnamed
Added file: http://bugs.python.org/file16598/dir.patch

___
Python tracker 
<http://bugs.python.org/issue7977>
___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 <mailto:rep...@bugs.python.org";>rep...@bugs.python.org>

Florent Xicluna <mailto:la...@yahoo.fr";>la...@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"; 
target="_blank">http://bugs.python.org/file16308/issue7977_test_xmlrpc.log

___
Python tracker <mailto:rep...@bugs.python.org";>rep...@bugs.python.org>
<http://bugs.python.org/issue7977"; 
target="_blank">http://bugs.python.org/issue7977>
___
-- Contact me: 
 QQ: 2578717MSN: mailto:sinoje...@msn.cn";>sinoje...@msn.cn新浪微博:http://t.sina.com.cn/sinojelly";>http://t.sina.com.cn/sinojelly
我的博客:http://sinojelly.20x.cc";>http://sinojelly.20x.cc

diff -Nur old\test\test_xmlrpc.py new\test\test_xmlrpc.py
--- old\test\test_xmlrpc.py Thu Aug 13 18:30:32 2009
+++ new\test\test_xmlrpc.py Sat Mar 20 19:39:48 2010
@@ -478,6 +478,14 @@
 # This avoids waiting for the socket timeout.
 self.test_simple1()
 
+def test_call_with_tuple_param(self):
+def execute(server, methodname, *args):
+r = getattr(server, methodname)(args) # params become a tuple
+return r
+p = xmlrpclib.ServerProxy(URL)
+r = execute(p, "add", 4,7)
+self.assertEqual(r, 11)
+
 # This is a contrived way to make a failure occur on the server side
 # in order to test the _send_traceback_header flag on the server
 class FailingMessageClass(http.client.HTTPMessage):
diff -Nur old\xmlrpc\client.py new\xmlrpc\client.py
--- old\xmlrpc\client.pyThu Jun 04 17:11:52 2009
+++ new\xmlrpc\client.pySat Mar 20 19:41:03 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-03-20 cgd Avoid to make a tuple to be another tuple(Chenguodong 
email:sinoje...@gmail.com)
 #
 # Copyright (c) 1999-2002 by Secret Labs AB.
 # Copyright (c) 1999-2002 by Fredrik Lundh.
@@ -1026,6 +1027,9 @@
 def __getattr__(self, name):
 return _Method(self.__send, "%s.%s" % (self.__name, name))
 def __call__(self, *args):
+# Fixed by sinojelly: if args[0] is a tuple, should not make it to be 
another tuple.
+if len(args) == 1 and type(args[0]) is type(()):
+args = args[0]
 return self.__send(self.__name, args)
 
 ##
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com