Comments (4)
@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.
@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.
OK great, thanks for the update, mahtin.
from python-cloudflare.
@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)
- New rulesets API endpoints for WAF configuration HOT 2
- cli4: /zones/:demo.ps/dns_records/import - demo.ps: not found HOT 21
- package add (http/socks5) network proxy parameters HOT 4
- Installing package takes too long with poetry HOT 4
- Package no longer works after updating pip packages HOT 6
- Goldmouth81
- I'm not getting the right DNS record_id HOT 1
- Deposit
- How to access R2 storage to perform CRUD on Bucket and Objects HOT 3
- Token authentication fails when using python-cloudflare versions above 2.8.15 HOT 8
- python-cloudflare is not PEP-561 aware HOT 2
- UnicodeDecodeError: 'gbk' codec can't decode byte 0x88 in position 16820: illegal multibyte sequence HOT 2
- HTTP method calls should be able to define content-header (headers) HOT 6
- Image error: /opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/tests/__init__.py HOT 8
- 1012 Request must contain one of "purge_everything", "files", "tags", "hosts" or "prefixes" HOT 8
- Change WAF Custom Rule with wrong position HOT 1
- Get code and message from CloudFlare.exceptions.CloudFlareAPIError HOT 7
- CloudFlareError does not evaluate to true if there are no chained errors HOT 7
- Bad request for direct image upload HOT 6
- Regression in 2.18.0 HOT 8
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 python-cloudflare.