Comments (5)
On Nov 29, 2013, at 6:33, bastiak [email protected] wrote:
--> 348 s = u'.'.join([encodings.idna.ToUnicode(_escapify(x)) for x in l])
I think we need to call something like _escapify after calling encodings.idna.ToUnicode(), but I'm not quite sure what that something is. Clearly "." (and perhaps unicode equivalents to ".") need to be escaped, and escaping space seems sensible, but on the other hand just calling _escapify() is bad because it ends up escaping unicode code points > 127, which seems bad.
I don't know enough about Unicode to know if other whitespace-like things need escaping, if there are any.
I will ponder this further, but anyone who knows Unicode well is encouraged to help :)
/Bob
from dnspython.
Sorry for late answer, I was busy.
In my opinion, in encodings.idna.ToUnicode(value) value should be "de-escapified" string.
Also in encodings.idna.ToASCII(value2) value2 should be pure unicode without escaping.
Python lib handles special cases and will throw an error if it happens.
I'm not sure, but in my opinion the dns.name.to_unicode() method should provide only human readable form of the domain name without any escaping.
from dnspython.
Hi,
do you accept my proposal?
dns.name.from_unicode() should remove any escaping and make a pure unicode string per label, then encode labels with encodings.idna.ToASCII() (labels are stored in punycoded notation without escaping)
dns.name.Name.to_unicode() should convert labels with encodings.idna.ToUnicode() and then escape characters per label
dns.name.Name.to_text() should only escape some required characters per label
I haven't inspected to_wire() and from_wire() yet.
I would like to make a patch.
Bastiak
from dnspython.
On Mar 28, 2014, at 6:44, bastiak [email protected] wrote:
Hi,
do you accept my proposal?dns.name.from_unicode() should remove any escaping and make a pure unicode string per label, then encode labels with encodings.idna.ToASCII() (labels are stored in punycoded notation without escaping)
Yes
dns.name.Name.to_unicode() should convert labels with encodings.idna.ToUnicode() and then escape characters per labelThis is probably the right thing, but the escaping is different. Probably only the "special characters" in _escaped should be escaped, and perhaps values < 0x20, but values >= 0x80 need to be left alone.
dns.name.Name.to_text() should only escape some required characters per labeldns.name.Name.to_text() should not be changed at all.
I haven't inspected to_wire() and from_wire() yet.
These should not be changed either.
/Bob
from dnspython.
but spaces are not allowed in domain names ...
from dnspython.
Related Issues (20)
- Strange Behavior When Unpickling HOT 4
- [asyncio] Blocking call to import_module in rdata.py HOT 5
- Timeout for TXT records that are too large HOT 2
- Issue in Hostname Resolution with multiple Nameservers HOT 2
- Parsing of KEY records HOT 8
- AttributeError: 'NoneType' object has no attribute 'split' on importing dns.query HOT 7
- dns.resolver.override_system_resolver doesnt work in windows HOT 2
- Installing dnspython doesn't work HOT 2
- with `raise_on_no_answer=False`, dns.resolver.Answer objects evaluate inconsistently depending on what sections are present in a reply HOT 2
- New RRTYPE in IANA registry HOT 7
- Wrong A-records results HOT 4
- RFC 9567: EDNS0 Report-Channel (DNS Error Reporting) HOT 3
- More linting with ruff? HOT 1
- Resolver should raise more specific errors when Extended DNS Errors (RFC 8914) is used. HOT 5
- Nameservers not read correctly from Windows 10. HOT 4
- win32api DLL load error after upgrading to 2.6.1 from 2.4.2 HOT 6
- TSIG RR cannot be read without validating it HOT 10
- TXT from_wire() permits an empty list (zero rdlen) HOT 1
- AXFR over TLS only fetches part of the zone file HOT 2
- Unable to call dns.zone.from_xfr method with non-relativized names HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dnspython.