Fix BUG #1084 - "Crash (segfault) when writing unicode string on socket"
See http://bugs.pyside.org/show_bug.cgi?id=1084. Signed-off-by: Paulo Alcantara <pcacjr@gmail.com> Reviewed-by: Trust me
This commit is contained in:
parent
8ddbd3167b
commit
481ba5aa3e
3 changed files with 25 additions and 13 deletions
|
|
@ -2673,12 +2673,7 @@
|
||||||
<modify-function signature="readLine(char*, qint64)" remove="all"/>
|
<modify-function signature="readLine(char*, qint64)" remove="all"/>
|
||||||
<!-- ### write(str) do the job -->
|
<!-- ### write(str) do the job -->
|
||||||
<modify-function signature="write(const char*, qint64)" remove="all"/>
|
<modify-function signature="write(const char*, qint64)" remove="all"/>
|
||||||
<modify-function signature="write(const char *)">
|
<modify-function signature="write(const char*)" remove="all"/>
|
||||||
<inject-code>
|
|
||||||
%RETURN_TYPE %0 = %CPPSELF.%FUNCTION_NAME(%1, Shiboken::String::len(%PYARG_1));
|
|
||||||
%PYARG_0 = %CONVERTTOPYTHON[%RETURN_TYPE](%0);
|
|
||||||
</inject-code>
|
|
||||||
</modify-function>
|
|
||||||
<modify-function signature="getChar(char*)">
|
<modify-function signature="getChar(char*)">
|
||||||
<modify-argument index="1">
|
<modify-argument index="1">
|
||||||
<remove-argument />
|
<remove-argument />
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
PYSIDE_TEST(bug_446.py)
|
PYSIDE_TEST(bug_446.py)
|
||||||
|
PYSIDE_TEST(bug_1084.py)
|
||||||
PYSIDE_TEST(basic_auth_test.py)
|
PYSIDE_TEST(basic_auth_test.py)
|
||||||
PYSIDE_TEST(accessManager_test.py)
|
PYSIDE_TEST(accessManager_test.py)
|
||||||
PYSIDE_TEST(http_test.py)
|
PYSIDE_TEST(http_test.py)
|
||||||
|
|
|
||||||
16
tests/QtNetwork/bug_1084.py
Normal file
16
tests/QtNetwork/bug_1084.py
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
''' unit test for BUG #1084 '''
|
||||||
|
|
||||||
|
import unittest
|
||||||
|
from PySide import QtNetwork
|
||||||
|
import py3kcompat as py3k
|
||||||
|
|
||||||
|
class QTcpSocketTestCase(unittest.TestCase):
|
||||||
|
def setUp(self):
|
||||||
|
self.sock = QtNetwork.QTcpSocket()
|
||||||
|
self.sock.connectToHost('127.0.0.1', 25)
|
||||||
|
|
||||||
|
def testIt(self):
|
||||||
|
self.sock.write(py3k.unicode_('quit'))
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
unittest.main()
|
||||||
Loading…
Add table
Add a link
Reference in a new issue