Message9877

Author Arfrever
Recipients Arfrever, zyasoft
Date 2015-04-17.16:40:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1429288841.33.0.705505131508.issue2331@psf.upfronthosting.co.za>
In-reply-to
Content
>>> import _socket
>>> str(_socket.error(-1, "Sieć jest niedostępna"))
'[Errno -1] Sie\xc4\x87 jest niedost\xc4\x99pna'
>>> str(_socket.error(-1, u"Sieć jest niedostępna"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
java.lang.IllegalArgumentException: Cannot create PyString with non-byte value
        at org.python.core.PyString.<init>(PyString.java:64)
        at org.python.core.PyString.<init>(PyString.java:70)
        at org.python.core.Py.newString(Py.java:641)     
        at org.python.core.exceptions.EnvironmentError__str__(exceptions.java:280)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.python.core.exceptions$BoundStaticJavaMethod.__call__(exceptions.java:677)
        at org.python.core.PyObject.__call__(PyObject.java:445)
        at org.python.core.PyBaseExceptionDerived.__str__(PyBaseExceptionDerived.java:65)
        at org.python.core.PyString.str_new(PyString.java:164)
        at org.python.core.PyString$exposed___new__.new_impl(Unknown Source)
        at org.python.core.PyType.invokeNew(PyType.java:494)
        at org.python.core.PyType.type___call__(PyType.java:1690)
        at org.python.core.PyType.__call__(PyType.java:1680)
        at org.python.core.PyObject.__call__(PyObject.java:461)
        at org.python.core.PyObject.__call__(PyObject.java:465)
        at org.python.pycode._pyx4.f$0(<stdin>:1)
        at org.python.pycode._pyx4.call_function(<stdin>)
        at org.python.core.PyTableCode.call(PyTableCode.java:167)
        at org.python.core.PyCode.call(PyCode.java:18)
        at org.python.core.Py.runCode(Py.java:1386)
        at org.python.core.Py.exec(Py.java:1430)
        at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:276)
        at org.python.util.InteractiveInterpreter.runcode(InteractiveInterpreter.java:131)
        at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:116)
        at org.python.util.InteractiveInterpreter.runsource(InteractiveInterpreter.java:62)
        at org.python.util.InteractiveConsole.push(InteractiveConsole.java:179)
        at org.python.util.InteractiveConsole._interact(InteractiveConsole.java:160)
        at org.python.util.InteractiveConsole.interact(InteractiveConsole.java:120)
        at org.python.util.jython.run(jython.java:415)
        at org.python.util.jython.main(jython.java:142)

java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: Cannot create PyString with non-byte value



This problem was originally noticed in test suite of pymongo-3.0 with non-English locales:
$ LC_ALL="en_US.UTF-8" jython2.7 -m unittest test.test_pooling.TestPoolMaxSize.test_max_pool_size_with_connection_failure
Got this failure java.net.SocketException: Network is unreachable during connect (<_realsocket at 0x2 type=client open_count=1 channel=[id: 0x18679e5f, 0.0.0.0/0.0.0.0:53816] timeout=1.0>)
Got this failure java.net.SocketException: Network is unreachable during connect (<_realsocket at 0x3 type=client open_count=1 channel=[id: 0xbd419398, 0.0.0.0/0.0.0.0:56258] timeout=1.0>)
.
----------------------------------------------------------------------
Ran 1 test in 2.184s

OK
$ LC_ALL="pl_PL.UTF-8" jython2.7 -m unittest test.test_pooling.TestPoolMaxSize.test_max_pool_size_with_connection_failure
Got this failure java.net.SocketException: Sieć jest niedostępna during connect (<_realsocket at 0x2 type=client open_count=1 channel=[id: 0x920a6791, 0.0.0.0/0.0.0.0:35129] timeout=1.0>)
E
======================================================================
ERROR: test_max_pool_size_with_connection_failure (test.test_pooling.TestPoolMaxSize)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test/test_pooling.py", line 445, in test_max_pool_size_with_connection_failure
    for i in range(2):
  File "/usr/share/jython-2.7/Lib/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "/usr/share/jython-2.7/Lib/contextlib.py", line 17, in __enter__
    return self.gen.next()
  File "pymongo/pool.py", line 509, in get_socket
    sock_info = self._get_socket_no_auth()
  File "pymongo/pool.py", line 543, in _get_socket_no_auth
    sock_info, from_pool = self.connect(), False
  File "pymongo/pool.py", line 482, in connect
    _raise_connection_failure(self.address, error)
  File "pymongo/pool.py", line 54, in _raise_connection_failure
    msg = '%s:%d: %s' % (host, port, error)
IllegalArgumentException: java.lang.IllegalArgumentException: Cannot create PyString with non-byte value

----------------------------------------------------------------------
Ran 1 test in 1.200s

FAILED (errors=1)

In last traceback, 'error' variable is instance of _socket.error with args[0] = -1 and args[1] = u'Unmapped exception: java.net.SocketException: Sie\u0107 jest niedost\u0119pna'.
History
Date User Action Args
2015-04-17 16:40:41Arfreversetrecipients: + Arfrever, zyasoft
2015-04-17 16:40:41Arfreversetmessageid: <1429288841.33.0.705505131508.issue2331@psf.upfronthosting.co.za>
2015-04-17 16:40:41Arfreverlinkissue2331 messages
2015-04-17 16:40:40Arfrevercreate