[issue12931] xmlrpclib confuses unicode and string
New submission from Wolfgang Schnerring : This is a similar issue to http://bugs.python.org/issue7093, but more insiduous: This works: xmlrpclib.ServerProxy(u'http://localhost:8080').foo(dict(baz=u'bär')) While this fails with a UnicodeDecodeError (note the trailing slash in the URI): xmlrpclib.ServerProxy(u'http://localhost:8080/').foo(dict(baz=u'bär')) File "/usr/local/python2.7/lib/python2.7/httplib.py", line 937, in endheaders self._send_output(message_body) File "/usr/local/python2.7/lib/python2.7/httplib.py", line 795, in _send_output msg += message_body UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 139: ordinal not in range(128) So, somewhere in xmlrpclib, confusion happens, since even though the URI is passed in as unicode both times, it is stored as string in the first case (thus compatible with the serialized, utf-8 encoded string of the message body), but in the second case it remains unicode (thus failing, as #7093 tells, which I personally wouldn't have closed wontfix). -- components: Library (Lib) messages: 143680 nosy: wosc priority: normal severity: normal status: open title: xmlrpclib confuses unicode and string type: behavior versions: Python 2.6, Python 2.7 ___ Python tracker <http://bugs.python.org/issue12931> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12931] xmlrpclib confuses unicode and string
Wolfgang Schnerring added the comment: I guess it should use the configured encoding[1] (which is utf-8 by default) to do that, shouldn't it? Since that's the encoding that is used for the message body, too. [1] http://docs.python.org/library/xmlrpclib.html#xmlrpclib.ServerProxy -- ___ Python tracker <http://bugs.python.org/issue12931> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5727] doctest pdb readline broken
New submission from Wolfgang Schnerring : When pdb is called from inside a doctest under python2.5, the readline keys do not work anymore -- like they did just fine in 2.4. Steps to reproduce: 1. Create two files, foo.txt and foo.py, like so: $ cat > foo.txt >>> import pdb; pdb.set_trace() $ cat > foo.py import doctest; doctest.testfile('foo.txt') 2. run it $ python2.5 foo.py 3. If I now press Ctrl-P, I get "^P" printed on the prompt, instead of going back in the readline history. Likewise, the arrow keys print escape sequences instead of moving the cursor. -- components: Library (Lib) messages: 85808 nosy: wosc severity: normal status: open title: doctest pdb readline broken type: behavior versions: Python 2.5 ___ Python tracker <http://bugs.python.org/issue5727> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5727] doctest pdb readline broken
Wolfgang Schnerring added the comment: I've tracked down the reason by diffing pdb.py and cmd.py between 2.4 and 2.5: It turns out that pdb.Pdb in 2.5 changes the way it handles input depending on whether an explicit output was provided, more precisely, it disables readline in that case. I don't understand what's going on here, but there is a simple, non-intrusive fix on the doctest side, see the attached patch. Unfortunately, I can't imagine how to write a test to check this behaviour. -- keywords: +patch Added file: http://bugs.python.org/file14193/doctest-readline.patch ___ Python tracker <http://bugs.python.org/issue5727> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com