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

Python 3.x internet documentation needs work #49008

Closed
beazley mannequin opened this issue Dec 27, 2008 · 11 comments
Closed

Python 3.x internet documentation needs work #49008

beazley mannequin opened this issue Dec 27, 2008 · 11 comments
Labels
docs Documentation in the Doc dir easy type-feature A feature request or enhancement

Comments

@beazley
Copy link
Mannequin

beazley mannequin commented Dec 27, 2008

BPO 4758
Nosy @birkenfeld, @terryjreedy, @orsenthil, @giampaolo, @ezio-melotti, @merwok

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 = None
closed_at = <Date 2012-09-26.17:26:51.869>
created_at = <Date 2008-12-27.13:14:39.404>
labels = ['easy', 'type-feature', 'docs']
title = 'Python 3.x internet documentation needs work'
updated_at = <Date 2012-09-26.17:26:51.868>
user = 'https://bugs.python.org/beazley'

bugs.python.org fields:

activity = <Date 2012-09-26.17:26:51.868>
actor = 'ezio.melotti'
assignee = 'docs@python'
closed = True
closed_date = <Date 2012-09-26.17:26:51.869>
closer = 'ezio.melotti'
components = ['Documentation']
creation = <Date 2008-12-27.13:14:39.404>
creator = 'beazley'
dependencies = []
files = []
hgrepos = []
issue_num = 4758
keywords = ['easy']
message_count = 11.0
messages = ['78361', '78376', '89969', '96895', '96897', '96898', '96985', '118370', '118404', '118422', '130407']
nosy_count = 9.0
nosy_names = ['georg.brandl', 'terry.reedy', 'beazley', 'orsenthil', 'giampaolo.rodola', 'ezio.melotti', 'eric.araujo', 'yu_jin_zhi', 'rafe.kettler']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue4758'
versions = ['Python 3.1', 'Python 3.2']

@beazley
Copy link
Mannequin Author

beazley mannequin commented Dec 27, 2008

I have recently completed a pretty thorough survey of library
documentation for Python 3.0 in conjunction with an update I'm making to
my book. This issue is not so much a bug as a documentation request.

For all of the library modules related to network programming, it would
be extremely useful to be much very explicit about what methods work
with strings and what methods requires byte. So many of these modules
operate on small fragments of data (e.g., send a request, add a header,
parse a query string, etc.). Sometimes using a string is okay,
sometimes it's not and sadly, it's not often predictable. Part of the
problem is that the documentation has been written for a Python 2 world
where text strings and binary data were interchangeable.

Anyways, this request minimally covers these modules:

  ftplib
  smtplib
  nntplib
  http.\*
  urllib.\*
  xmlrpc.\*
  socketserver
  asynchat
  asyncore

If there is interest, I can submit more detailed notes from my own work,
but I'm not sure how the documentation maintainer would want this.
Separate issue for each? Added as comments here? Please advise.

@beazley beazley mannequin assigned birkenfeld Dec 27, 2008
@beazley beazley mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Dec 27, 2008
@birkenfeld
Copy link
Member

I'd be happy with comments on this bug. I can't promise that I'll have
the time to review everything, but the more specific the remarks are,
the easier it's for me to update the docs.

Thanks for your efforts!

@devdanzin devdanzin mannequin added the easy label Apr 22, 2009
@ezio-melotti
Copy link
Member

David, I think that a list of notes posted here is ok, can you still
provide them?

@yujinzhi
Copy link
Mannequin

yujinzhi mannequin commented Dec 27, 2009

As my opinion, Adding them as comments here is better as we can see the
same kind of issues all at once.

@ezio-melotti
Copy link
Member

If David doesn't answer I'd close this issue. A year passed since the
first message and several bugs have been probably fixed already.

@orsenthil
Copy link
Member

Hi Ezio, let us not close the issue. Waiting for David Beazley's patch
is okay or even looking at specific modules pointed out from the point
of str vs bytes interfaces and if any docs can be improved, we can
improve them. If we determine there is none, then we can close it as fixed.

@pitrou pitrou changed the title Python 3.0 internet documentation needs work Python 3.x internet documentation needs work Dec 28, 2009
@beazley
Copy link
Mannequin Author

beazley mannequin commented Dec 29, 2009

An apology on the delay. Things have been rather hectic.

Regarding a patch, I don't really have a patch so much as a suggested
procedure. Basically, I'm suggesting that the maintainers of the
library documentation simply do a quick survey of network related
modules and make it clear that many of the operations work on "byte
strings" and not "strings." In Python 2.X, you could get away with
being a little sloppy, but in Python 3, the bytes/strings distinction
becomes much more prominent.

If I have time, I might be able to make a specific patch, but it
probably wouldn't be until after PyCON sometime.

@rafekettler
Copy link
Mannequin

rafekettler mannequin commented Oct 11, 2010

I stumbled upon this issue and I feel similarly about the documentation for a particular module, ftplib. I think that the documentation is a bit too concise and assumes that the reader in an expert in the protocol when the point of the module is to abstract out such details.

For example, for the error documentation, the exceptions are only explained by the error code the server can return to trigger them. So, while the explanation of error_perm, for example, should say something about permissions, it just says "raised when an error code in the range 500–599 is received." This is particularly unclear for those with no knowledge of the internals of the protocol.

Also, in the documentation for RetrLines(), the documentation mentions the options LIST, NLST, and MLSD without explaining what they are. I know that when I first started using ftplib I had to experiment with each option to determine what they do, and I think it would be better if this was clear in the docs from the start.

I can propose a patch to the documentation if needed.

@merwok
Copy link
Member

merwok commented Oct 12, 2010

Rafe, thank you for your message and willingness to contribute. I feel what you’re reporting is another bug: the original report talks about bytes/str confusion only, not about the simplicity of the APIs. Could you open another bug with component “Documentation” and add orsenthil to the nosy list? Thanks in advance.

@rafekettler
Copy link
Mannequin

rafekettler mannequin commented Oct 12, 2010

Thanks Eric, I think you're right. I'll do that.

@admin admin mannequin assigned docspython and unassigned birkenfeld Oct 29, 2010
@terryjreedy
Copy link
Member

I believe 3.2 has many code and doc improvements with respect to bytes/string usage. So it is hard to know what is still needed.

I think the way for anyone to advance this is to review just one of the modules listed and either report here that all is ok or open another issue just for that module and give a reference here.

@ezio-melotti ezio-melotti added the stale Stale PR or inactive for long period of time. label Mar 10, 2011
@ezio-melotti ezio-melotti removed the stale Stale PR or inactive for long period of time. label Sep 26, 2012
@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 easy type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

5 participants