Skip to content

Update urlparse.py #355

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

Closed
wants to merge 2 commits into from
Closed

Conversation

djallalzoldik
Copy link

Hi , team

i was able to convert urlparse.py from urllib that in python3 > https://raw.githubusercontent.com/python/cpython/3.9/Lib/urllib/parse.py

i was able to convert it to be compatible with pytho2
i already test it and it work fine

@jeff5
Copy link
Member

jeff5 commented Sep 2, 2024

Thanks for offering this and for the work behind it.

We haven't previously backported code from Python 3, and I'm wary of starting now. What's the motivation? How much of the URL universe does the existing version not parse? If you have a particular need in your application, there are always ways to patch in an improvement as a local library.

Technicalities if we want to consider this:

  • It's in the wrong place. lib-python is code we have copied from CPython for re-use and nobody changes it. What you would do is place the same module in the ~/Lib tree, then the build would use that instead.
  • As I understand it, urllib has grown significantly from Python 2 to Python 3. We would want to update the corresponding tests to Python 3. It may work fine for you, but we need to be able to test it every time we build. Again, these belong in the ~/Lib tree. This may be a difficult conversion because the test support has changed a lot.
  • Your starting version seems to be before the changes that finally landed urllib.parse space handling CVE-2023-24329 appears unfixed python/cpython#102153 . I don't know if the current Python 2 library has the same faults, but it seems unwise to expand the range of protocols without fixing a well-publicised CVE.
  • If I haven't put you off by now, there's a contributor agreement to sign.

@jeff5
Copy link
Member

jeff5 commented Sep 2, 2024

Baseline would be that it passes the existing tests (unless there's a good reason why they're wrong).

Copy link
Member

Choose a reason for hiding this comment

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

This does not appear to have anything to do with the PR.

Copy link
Author

Choose a reason for hiding this comment

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

I think all types of encoding are important. for the PR , specially in the new technologies or for the web3

@jeff5 jeff5 closed this Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants