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-86809: Add support for HTTP Range header in HTTPServer#118949

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

Open
lyc8503 wants to merge24 commits intopython:main
base:main
Choose a base branch
Loading
fromlyc8503:gh-86809

Conversation

lyc8503
Copy link
Contributor

@lyc8503lyc8503 commentedMay 11, 2024
edited by bedevere-appbot
Loading

Add support for the HTTPRange header to SimpleHTTPServer to solve#86809

tusharsadhwani reacted with heart emoji
@imba-tjd
Copy link
Contributor

imba-tjd commentedMay 23, 2024
edited
Loading

I didn't use it, but LGTM. Except I would preferparse_range thanget_range.

@lyc8503lyc8503 requested a review frompicnixzMay 23, 2024 14:30
Copy link
Member

@picnixzpicnixz left a comment

Choose a reason for hiding this comment

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

(I've just reviewed at the same time you marked some comments as outdated)

@lyc8503lyc8503 requested a review frompicnixzMay 23, 2024 15:36
Copy link
Member

@picnixzpicnixz left a comment

Choose a reason for hiding this comment

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

A few comments (I won't be available afterwards but I may comment tomorrow)

@lyc8503
Copy link
ContributorAuthor

Thanks for the suggestions, I've made some changes based on them.

@lyc8503lyc8503 requested a review frompicnixzMay 23, 2024 16:37
Copy link
Member

@picnixzpicnixz left a comment

Choose a reason for hiding this comment

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

Aaaand some final comments I think. Sorry to break down my reviews like that but I usually comment incrementally but I don't want people to be frustrated by my nitpicking (also, I don't see the point of reviewing something that could change after addressing other comments).

lyc8503 reacted with heart emoji
@lyc8503
Copy link
ContributorAuthor

Aaaand some final comments I think. Sorry to break down my reviews like that but I usually comment incrementally but I don't want people to be frustrated by my nitpicking (also, I don't see the point of reviewing something that could change after addressing other comments).

No worries, and thanks a lot for the detailed suggestions for my code! Your suggestions are very helpful.

picnixz reacted with heart emoji

@lyc8503lyc8503 requested a review frompicnixzMay 24, 2024 07:40
picnixz
picnixz previously approved these changesMay 24, 2024
Copy link
Member

@picnixzpicnixz left a comment

Choose a reason for hiding this comment

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

I personally don't have more comments to add (but as always, it's easy to miss something obvious when you've reviewd the same thing multiple times).

lyc8503 reacted with heart emoji
@hondogitsune
Copy link

hondogitsune commentedJun 28, 2024
edited
Loading

@arhadthedev
@JelleZijlstra
This would close a nearly4 year old issue and enhance cpython with one of the most basic features of HTTP servers, range requests.

Please review if possible.

spacesynth, lyc8503, rebane2001, brw, tusharsadhwani, and JCash reacted with heart emoji

@JCash
Copy link

Ping! (I hope it's ok to ping every 6 months or so, especially if it seems to be so nearly done :) )

Copy link
Member

@picnixzpicnixz left a comment

Choose a reason for hiding this comment

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

Now that I've got more insights on how CPython's workflow works, I'd like you to address the following changes.

@picnixzpicnixz dismissed theirstale reviewDecember 8, 2024 23:37

Additional work is needed (work that I wasn't aware of in May...)

@ghost
Copy link

ghost commentedDec 15, 2024
edited by ghost
Loading

All commit authors signed the Contributor License Agreement.
CLA signed

@lyc8503
Copy link
ContributorAuthor

Does this need to be changed?
We can increase the number but I wouldn't bother (check git blame to see when it was last updated for instance)

This field has not been changed for 17 years😂. I guess we can leave it as is.

image

picnixz and imba-tjd reacted with laugh emoji

Copy link
Member

@picnixzpicnixz left a comment

Choose a reason for hiding this comment

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

The coverage is good but the test function is a bit big. Maybe it's better to split into multiple functions (for instance, we can also name ittest_single_range_get_* and have atest_multi_range_get case which only verifies that we ignore that part for now)

lyc8503 reacted with thumbs up emoji
@lyc8503lyc8503 requested a review frompicnixzJanuary 12, 2025 06:14
Copy link
Member

@picnixzpicnixz left a comment

Choose a reason for hiding this comment

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

Almost there. The remaining are just nitpicks to ease future extensions and for tracking future issues if any.

@lyc8503
Copy link
ContributorAuthor

FTR, can we actually a link that that comment to indicate the rationale of this choice? Since the PR has quite a lot of comments, it'd be easier if we want to find the rationale in the future.

Which specific comment do you refer to?

BTW, I realized thatparse_range() collapses(None, None) toNone simply becausebytes=- is not a valid range-specifier syntax, and I edited comments in code to indicate this.

@picnixz
Copy link
Member

Which specific comment do you refer to?

This one:#118949 (comment) or#118949 (comment).

Copy link
Member

@picnixzpicnixz left a comment

Choose a reason for hiding this comment

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

Sorry, I missed the What's New entry where using~ would only showsend_error and notBaseHTTPRequestHandler.send_error.

I'll let@vadmium decide when to merge after you've addressed that nit.

lyc8503 and spacesynth reacted with heart emoji
lyc8503and others added2 commitsJanuary 13, 2025 23:04
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@spacesynth
Copy link

spacesynth commentedFeb 6, 2025
edited
Loading

@vadmium
Please forgive me for pinging, you are probably swamped in work! If you have time to look at this <200 LoC PR any time I'd be giggling in glee!

ran-sama reacted with thumbs up emojilyc8503 reacted with rocket emoji

@lyc8503
Copy link
ContributorAuthor

Oh... I suddenly realized that Python 3.14 has already reached beta freeze, but this PR hasn't been merged yet, should I change the target version number to 3.15?

@picnixz
Copy link
Member

Yes, I'm sorry I forgot about it.

@lyc8503
Copy link
ContributorAuthor

No worries, I didn't notice that either. Let me change it tomorrow.

@picnixzpicnixz self-requested a reviewMay 26, 2025 23:22
@hondogitsune
Copy link

hondogitsune commentedMay 27, 2025
edited
Loading

Sorry for the thread bump:
What future Python version is being targeted at the moment for the release of this good feature?

@lyc8503
Copy link
ContributorAuthor

What future Python version is being targeted at the moment for the release of this good feature?

Since we forgot to merge it in before the 3.14 feature freeze, you'll only see it in Python 3.15 at the earliest (a little over a year from now).

Let me change it tomorrow.

Sorry I haven't changed it yet. I see that there are still a lot of TODOs in the 3.15 whatsnew file, and I'm worried that there will be conflicts soon in the future if I change it now. Maybe I'll wait for the 3.15 whatsnew file to have a little bit more content.

hondogitsune reacted with thumbs up emojispacesynth reacted with heart emoji

@picnixz
Copy link
Member

Don't worry about the todos. Just add a new http (or http.client I don't remember where the code is) section under improved modules (it there isn't oe already).

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@imba-tjdimba-tjdimba-tjd left review comments

@vadmiumvadmiumAwaiting requested review from vadmium

@picnixzpicnixzAwaiting requested review from picnixz

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

7 participants
@lyc8503@imba-tjd@hondogitsune@JCash@picnixz@spacesynth@vadmium

[8]ページ先頭

©2009-2025 Movatter.jp