Stéphane Wirtel <[email protected]> added the comment:
I confirm that you don't use socket.makefile in write mode.
Python 3.7.2 (default, Jan 16 2019, 19:49:22)
[GCC 8.2.1 20181215 (Red Hat 8.2.1-6)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> s = socket.socket()
>>> s.connect('localhost', 5432)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: connect() takes exactly one argument (2 given)
>>> s.connect(('localhost', 5432))
>>> S = s.makefile()
>>> print('hello world', file=S, flush=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
io.UnsupportedOperation: not writable
>>> S = s.makefile(mode='w')
>>> print('hello world', file=S, flush=True)
>>>
I close the issue.
----------
nosy: +matrixise
resolution: -> rejected
stage: -> resolved
status: open -> closed
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue36047>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com