Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket Python 3k Documentation mistake OR Unicode string is not supported with socket.send #47800

Closed
st33med mannequin opened this issue Aug 14, 2008 · 3 comments
Closed
Assignees
Labels
docs Documentation in the Doc dir

Comments

@st33med
Copy link
Mannequin

st33med mannequin commented Aug 14, 2008

BPO 3550
Nosy @birkenfeld

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 = <Date 2008-08-14.11:50:47.044>
created_at = <Date 2008-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 = <Date 2008-08-14.11:50:47.043>
user = 'https://bugs.python.org/st33med'

bugs.python.org fields:

activity = <Date 2008-08-14.11:50:47.043>
actor = 'georg.brandl'
assignee = 'georg.brandl'
closed = True
closed_date = <Date 2008-08-14.11:50:47.044>
closer = 'georg.brandl'
components = ['Documentation']
creation = <Date 2008-08-14.02:24:19.515>
creator = 'st33med'
dependencies = []
files = []
hgrepos = []
issue_num = 3550
keywords = []
message_count = 3.0
messages = ['71105', '71106', '71122']
nosy_count = 2.0
nosy_names = ['georg.brandl', 'st33med']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue3550'
versions = ['Python 3.0']

@st33med
Copy link
Mannequin Author

st33med mannequin commented 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 st33med mannequin added the type-bug An unexpected behavior, bug, or error label Aug 14, 2008
@st33med st33med mannequin assigned birkenfeld Aug 14, 2008
@st33med st33med mannequin added the docs Documentation in the Doc dir label Aug 14, 2008
@st33med
Copy link
Mannequin Author

st33med mannequin commented 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.

@st33med st33med mannequin 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 Aug 14, 2008
@st33med st33med mannequin removed the type-bug An unexpected behavior, bug, or error label Aug 14, 2008
@birkenfeld
Copy link
Member

Thanks, fixed the docs to refer to bytes objects in r65674.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

1 participant