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

symbol '_' not allowed #59

Closed
404notfoundhard opened this issue Mar 15, 2018 · 6 comments
Closed

symbol '_' not allowed #59

404notfoundhard opened this issue Mar 15, 2018 · 6 comments

Comments

@404notfoundhard
Copy link

д_ругойтест.рф
Codepoint U+005F at position 2 of 'д_ругойтест' not allowed

Full traceback:

Traceback (most recent call last):
  File "/home/user/somedirectory/code.py", line 34, in <module>
    punnycode_to_replace = idna.encode("д_ругойтест.рф")
  File "/usr/local/lib/python3.5/dist-packages/idna/core.py", line 355, in encode
    result.append(alabel(label))
  File "/usr/local/lib/python3.5/dist-packages/idna/core.py", line 276, in alabel
    check_label(label)
  File "/usr/local/lib/python3.5/dist-packages/idna/core.py", line 253, in check_label
    raise InvalidCodepoint('Codepoint {0} at position {1} of {2} not allowed'.format(_unot(cp_value), pos+1, repr(label)))
idna.core.InvalidCodepoint: Codepoint U+005F at position 2 of 'д_ругойтест' not allowed
[Finished in 0.4s with exit code 1]
@jribbens
Copy link
Collaborator

Not a bug - see issue #50

@kjd
Copy link
Owner

kjd commented Mar 15, 2018

Works as expected.

@kjd kjd closed this as completed Mar 15, 2018
@404notfoundhard
Copy link
Author

Hmm, what about subdomens?

@kjd
Copy link
Owner

kjd commented Mar 15, 2018

Labels all have the same restrictions in IDNA whatever their placement in the whole domain name.

@sebschrader
Copy link

sebschrader commented Jan 25, 2022

It should be noted that SRV record labels do contain underscores (e.g. _ldap._tcp.example.com).

@jrlevine
Copy link

the _labels are not host names. Also, since they start with an underscore rather than xn-- IDNA obviously doesn't apply to them.

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

No branches or pull requests

5 participants