GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Docs: Fix getstatus() -> getcode() typos by hugovk · Pull Request #101296 · python/cpython

Conversation

@hugovk

@hugovk hugovk commented Jan 24, 2023

Copy link
Copy Markdown
Member

The docs say getstatus() for http.client.HTTPResponse and urllib.response.addinfourl:

  • https://docs.python.org/3/library/http.client.html#http.client.HTTPResponse.getstatus
  • https://docs.python.org/3/library/urllib.request.html#urllib.response.addinfourl.getstatus

But they're really getcode():

  • cpython/Lib/http/client.py

    Lines 778 to 783 in f02fa64

    def getcode(self):
    '''Return the HTTP status code that was sent with the response,
    or None if the URL is not an HTTP URL.
    '''
    return self.status
  • cpython/Lib/urllib/response.py

    Lines 80 to 81 in f02fa64

    def getcode(self):
    return self.code

The documentation (and typos) for these were added as part of #11447 for Python 3.9 in 2019, although the methods have been around much longer (2009 and 2008).

Let's backport to at least 3.10.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@hugovk
Fix getstatus() -> getcode() typos
c8883a5
@hugovk hugovk added docs Documentation in the Doc dir needs backport to 3.10 needs backport to 3.11 only security fixes labels Jan 24, 2023
@bedevere-bot bedevere-bot added awaiting core review skip news labels Jan 24, 2023
@hugovk hugovk added the skip issue label Jan 24, 2023
@hugovk hugovk mentioned this pull request Feb 5, 2023
bpo-12707: deprecate info(), geturl(), getcode() methods in favor of headers, url, and status properties for HTTPResponse and addinfourl #11447
Merged
eamanu
eamanu approved these changes Feb 6, 2023
View reviewed changes

@eamanu eamanu left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@hugovk
hugovk merged commit 61f2be0 into python:main Feb 10, 2023
@hugovk
hugovk deleted the fix-getstatus-getcode-typos branch February 10, 2023 18:46
@miss-islington

miss-islington commented Feb 10, 2023

Copy link
Copy Markdown
Contributor

Thanks @hugovk for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10, 3.11.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the awaiting core review label Feb 10, 2023
@miss-islington

miss-islington commented Feb 10, 2023

Copy link
Copy Markdown
Contributor

Sorry @hugovk, I had trouble checking out the 3.11 backport branch.
Please retry by removing and re-adding the "needs backport to 3.11" label.
Alternatively, you can backport using cherry_picker on the command line.
cherry_picker 61f2be08661949e2f6dfc94143436297e60d47de 3.11

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington miss-islington assigned hugovk Feb 10, 2023
@bedevere-bot

bedevere-bot commented Feb 10, 2023

Copy link
Copy Markdown

GH-101804 is a backport of this pull request to the 3.10 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 label Feb 10, 2023
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 10, 2023
@hugovk @miss-islington
Docs: Fix getstatus() -> getcode() typos (pythonGH-101296)
2f1dba6
(cherry picked from commit 61f2be0)

Co-authored-by: Hugo van Kemenade <[email protected]>
@bedevere-bot

bedevere-bot commented Feb 10, 2023

Copy link
Copy Markdown

GH-101805 is a backport of this pull request to the 3.11 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the needs backport to 3.11 only security fixes label Feb 10, 2023
hugovk added a commit to hugovk/cpython that referenced this pull request Feb 10, 2023
@hugovk
Docs: Fix getstatus() -> getcode() typos (python#101296)
5b6a4e1
carljm added a commit to carljm/cpython that referenced this pull request Feb 10, 2023
@carljm
Merge branch 'main' into inlinecomp2
36b2917
* main:
  Docs: Fix getstatus() -> getcode() typos (python#101296)
  Docs: use parameter list for sqlite3.Cursor.execute* (python#101782)
  pythongh-101763: Update bundled copy of libffi to 3.4.4 on Windows (pythonGH-101784)
  pythongh-101517: make bdb avoid looking up in linecache with lineno=None (python#101787)
  pythongh-101759: Update Windows installer to SQLite 3.40.1 (python#101762)
  pythongh-101277: Finalise isolating itertools (pythonGH-101305)
  pythongh-101759: Update macOS installer to SQLite 3.40.1 (python#101761)
miss-islington added a commit that referenced this pull request Feb 10, 2023
@miss-islington @hugovk
Docs: Fix getstatus() -> getcode() typos (GH-101296)
2e7ff1f
(cherry picked from commit 61f2be0)

Co-authored-by: Hugo van Kemenade <[email protected]>
hugovk added a commit that referenced this pull request Feb 10, 2023
@hugovk
[3.11] Docs: Fix getstatus() -> getcode() typos (GH-101296) (#101805)
c485f0e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@eamanu eamanu eamanu approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@hugovk hugovk

Labels

docs Documentation in the Doc dir skip issue skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@hugovk @miss-islington @bedevere-bot @eamanu
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.