Coder Social home page Coder Social logo

Comments (4)

mahtin avatar mahtin commented on August 17, 2024

@FutureSharks - oops! Normally I would say there's some code you need to dig up in order to make punycode and domain names work cleanly together. Python does a so-so job at doing this.

You are correct that xn--sanremomlheim-3ob.de is sanremomülheim.de. However sanremom\u0102\u017alheim.de as you say is sanremomĂźlheim.de which is clearly wrong.

Off to debug ... more later!

from python-cloudflare.

mahtin avatar mahtin commented on August 17, 2024

@FutureSharks - I've created an internal ticket to address this. The name value in the response from a /zones API call is wrong. The zone_name value in the response from a /zones/:id/dns_records API call is correct. This should work for you ...

>>>print dns_records[0]['zone_name']
www.sanremomülheim.de

I'll update you when there's a change to the API calls.

In other news. The cli4 command also had a small python bug that stopped it working with IDNs. If you grab the latest from github (or pip version 1.4.11 or above) you will be able to test this on the command line.

$ cli4 /zones/:sanremomülheim.de
...
$
$ cli4 /zones/:sanremomülheim.de/dns_records
...
$

from python-cloudflare.

FutureSharks avatar FutureSharks commented on August 17, 2024

OK great, thanks for the update, mahtin.

from python-cloudflare.

mahtin avatar mahtin commented on August 17, 2024

@FutureSharks - well it's been a long time and I've finally squashed the unicode bugs. I've also made the library python2/python3 compatible. Both the cli4 command and the libraries now do the right thing. This was purely an issue with strings and unicode and python2/python3 json. Here's my test zone and your example from above.

$ python3
Python 3.5.2 (default, Oct 11 2016, 05:05:28) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>> import CloudFlare
>>> cf = CloudFlare.CloudFlare()
>>> my_domain = cf.zones.get(params = { 'name': 'übergrösse.space' })
>>> my_domain[0]['name']
'übergrösse.space'
>>> dns_records = cf.zones.dns_records.get(my_domain[0]['id'])
>>> dns_records[0]['name']
'www.übergrösse.space'
>>> print(my_domain[0]['name'])
übergrösse.space
>>> print(dns_records[0]['name'])
www.übergrösse.space
>>>
>>>
>>> 
>>> my_domain = cf.zones.get(params = { 'name': 'xn--bergrsse-r4a8c.space' })
>>> my_domain[0]['name']
'übergrösse.space'
>>> dns_records = cf.zones.dns_records.get(my_domain[0]['id'])
>>> dns_records[0]['name']
'www.übergrösse.space'
>>> print(my_domain[0]['name'])
übergrösse.space
>>> print(dns_records[0]['name'])
www.übergrösse.space
>>>
>>> exit()
$

This is now pushed to GitHub and PyPI as version 2.0.4.

Please test and hopefully you this is acceptable.

from python-cloudflare.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.