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

Fix IPv6 zone handling, lowercase in domain name and compressed ip ad… #144

Closed
wants to merge 1 commit into from

Conversation

socketpair
Copy link

…dresses.

except ValueError:
pass
netloc = netloc.encode('idna').decode('ascii')
Copy link
Author

@socketpair socketpair Dec 14, 2017

Choose a reason for hiding this comment

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

In [15]: timeit 'lasdhglajkdshflkajsdfh.asdf.asdf.asdf.asdf.asdf.rtyty'.encode('ascii')
1000000 loops, best of 3: 283 ns per loop

In [16]: timeit 'lasdhglajkdshflkajsdfh.asdf.asdf.asdf.asdf.asdf.rtyty'.encode('idna').decode('ascii')
100000 loops, best of 3: 2.77 µs per loop

Copy link
Author

Choose a reason for hiding this comment

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

Is it the case ?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, don't follow the question.

@codecov
Copy link

codecov bot commented Dec 14, 2017

Codecov Report

Merging #144 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #144      +/-   ##
==========================================
+ Coverage   99.63%   99.63%   +<.01%     
==========================================
  Files           2        2              
  Lines         542      544       +2     
  Branches      135      137       +2     
==========================================
+ Hits          540      542       +2     
  Partials        2        2
Impacted Files Coverage Δ
yarl/__init__.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update dd2fddc...56b6bc4. Read the comment docs.

else:
(ip, *zone) = netloc.split('%', 1)
Copy link
Member

Choose a reason for hiding this comment

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

use .partition()

@asvetlov
Copy link
Member

Merged by 7d8f58b

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