You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Socket Python 3k Documentation mistake OR Unicode string is not supported with socket.send #47800
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/birkenfeld'closed_at=<Date2008-08-14.11:50:47.044>created_at=<Date2008-08-14.02:24:19.515>labels= ['docs']
title='Socket Python 3k Documentation mistake OR Unicode string is not supported with socket.send'updated_at=<Date2008-08-14.11:50:47.043>user='https://bugs.python.org/st33med'
I am confused by the socket docs for Python 3000. It says to pass a
string through socket.send or socket.sendall, however, it does not seem
to account for the ASCII to Unicode transition. Trying to send an
ordinary Python 3k string through socket.send fails with a TypeError
stating that the first arg must be bytes or buffers but not a str.
Besides the misdocumented sockets, I would think it would be easier to
translate a Unicode string to ASCII, however, I fear this might violate
the "Explicit is better than implicit" rule and RFC tables.
The examples at the bottom also add to the confusion.
Also, changed title to be friendlier (failure? Mistake, more likely) and
changed type to no selection.
changed the title [-]Socket Python 3k Documentation failure OR Unicode string is not supported with socket.send[/-][+]Socket Python 3k Documentation mistake OR Unicode string is not supported with socket.send[/+]on Aug 14, 2008
Activity
st33med commentedon Aug 14, 2008
I am confused by the socket docs for Python 3000. It says to pass a
string through socket.send or socket.sendall, however, it does not seem
to account for the ASCII to Unicode transition. Trying to send an
ordinary Python 3k string through socket.send fails with a TypeError
stating that the first arg must be bytes or buffers but not a str.
Besides the misdocumented sockets, I would think it would be easier to
translate a Unicode string to ASCII, however, I fear this might violate
the "Explicit is better than implicit" rule and RFC tables.
st33med commentedon Aug 14, 2008
http://docs.python.org/dev/3.0/library/socket.html
The examples at the bottom also add to the confusion.
Also, changed title to be friendlier (failure? Mistake, more likely) and
changed type to no selection.
[-]Socket Python 3k Documentation failure OR Unicode string is not supported with socket.send[/-][+]Socket Python 3k Documentation mistake OR Unicode string is not supported with socket.send[/+]birkenfeld commentedon Aug 14, 2008
Thanks, fixed the docs to refer to bytes objects in r65674.