Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-81403: Fix for CacheFTPHandler in urllib#13951

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
orsenthil merged 3 commits intopython:mainfromhemberger:master
Apr 23, 2023

Conversation

@hemberger
Copy link
Contributor

@hembergerhemberger commentedJun 10, 2019
edited by bedevere-bot
Loading

A call to FTP.ntransfercmd must be followed by FTP.voidresp to clear
the "end transfer" message. Without this, the client and server get
out of sync, which will result in an error if the FTP instance is
reused to open a second URL. This scenario occurs for even the most
basic usage of CacheFTPHandler.

Reverts the patch merged as a resolution tobpo-16270 and adds a test
case for the CacheFTPHandler in test_urllib2net.py.

https://bugs.python.org/issue37222

A call to FTP.ntransfercmd must be followed by FTP.voidresp to clearthe "end transfer" message. Without this, the client and server getout of sync, which will result in an error if the FTP instance isreused to open a second URL. This scenario occurs for even the mostbasic usage of CacheFTPHandler.Reverts the patch merged as a resolution to bpo-16270 and adds a testcase for the CacheFTPHandler in test_urllib2net.py.
@the-knights-who-say-ni

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed thePSF contributor agreement (CLA).

Our records indicate we have not received your CLA. For legal reasons we need you to sign this before we can look at your contribution. Please followthe steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You cancheck yourself to see if the CLA has been received.

Thanks again for your contribution, we look forward to reviewing it!

@bedevere-bot
Copy link

Every change to Pythonrequires a NEWS entry.

Please, add it using theblurb_it Web app or theblurb command-line tool.

@bedevere-bot
Copy link

Most changes to Pythonrequire a NEWS entry.

Please add it using theblurb_it web app or theblurb command-line tool.

@arhadthedevarhadthedev changed the titlebpo-37222: Fix for CacheFTPHandler in urllibgh-81403: Fix for CacheFTPHandler in urllibApr 23, 2023
@orsenthil
Copy link
Member

This change looks good to me. This fell out of attention due to lack of news and I cannot edit this PR. I will merge this and make a minor change and NEWS as a separate PR commit.

The NEWS entry I will add is

Fix ftplib endtransfer method to call void response. Fixes the issue when ftp url is reused or with CacheFTPHandler.

Copy link
Member

@orsenthilorsenthil left a comment

Choose a reason for hiding this comment

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

LGTM

@arhadthedev
Copy link
Member

arhadthedev commentedApr 23, 2023
edited
Loading

Fix ftplib endtransfer method to call void response. Fixes the issue when ftp url is reused or with CacheFTPHandler.

Maybe it's worth copying the issue text? Like:

:class:`urllib.request.CacheFTPHandler` no longer raises :class:`URLError` if a cached FTP instance is reused.

orsenthil reacted with thumbs up emoji

@orsenthil
Copy link
Member

@arhadthedev - sounds good to me.

arhadthedev reacted with thumbs up emoji

@arhadthedev
Copy link
Member

arhadthedev commentedApr 23, 2023
edited
Loading

It seemsautomerge was ignored.

@miss-islington
Copy link
Contributor

Thanks@hemberger for the PR, and@orsenthil for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestApr 23, 2023
bpo-37222: Fix for CacheFTPHandler in urllibA call to FTP.ntransfercmd must be followed by FTP.voidresp to clearthe "end transfer" message. Without this, the client and server getout of sync, which will result in an error if the FTP instance isreused to open a second URL. This scenario occurs for even the mostbasic usage of CacheFTPHandler.Reverts the patch merged as a resolution to bpo-16270 and adds a testcase for the CacheFTPHandler in test_urllib2net.py.(cherry picked from commite38bebb)Co-authored-by: Dan Hemberger <846186+hemberger@users.noreply.github.com>Co-authored-by: Senthil Kumaran <senthil@python.org>
@bedevere-bot
Copy link

GH-103705 is a backport of this pull request to the3.11 branch.

@bedevere-botbedevere-bot removed the needs backport to 3.11only security fixes labelApr 23, 2023
orsenthil added a commit that referenced this pull requestApr 23, 2023
*gh-81403: Fix for CacheFTPHandler in urllib (GH-13951)bpo-37222: Fix for CacheFTPHandler in urllibA call to FTP.ntransfercmd must be followed by FTP.voidresp to clearthe "end transfer" message. Without this, the client and server getout of sync, which will result in an error if the FTP instance isreused to open a second URL. This scenario occurs for even the mostbasic usage of CacheFTPHandler.Reverts the patch merged as a resolution tobpo-16270 and adds a testcase for the CacheFTPHandler in test_urllib2net.py.(cherry picked from commite38bebb)Co-authored-by: Dan Hemberger <846186+hemberger@users.noreply.github.com>Co-authored-by: Senthil Kumaran <senthil@python.org>* Added NEWS entry.---------Co-authored-by: Dan Hemberger <846186+hemberger@users.noreply.github.com>Co-authored-by: Senthil Kumaran <senthil@python.org>
orsenthil added a commit to orsenthil/cpython that referenced this pull requestApr 23, 2023
orsenthil added a commit that referenced this pull requestApr 23, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@orsenthilorsenthilorsenthil approved these changes

Assignees

No one assigned

Labels

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@hemberger@the-knights-who-say-ni@bedevere-bot@orsenthil@arhadthedev@miss-islington@ezio-melotti

[8]ページ先頭

©2009-2025 Movatter.jp