-
Notifications
You must be signed in to change notification settings - Fork 292
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 to decode Unicode Escape of multibyte strings #226
Fix to decode Unicode Escape of multibyte strings #226
Conversation
Codecov Report
@@ Coverage Diff @@
## main #226 +/- ##
==========================================
+ Coverage 77.17% 77.18% +0.01%
==========================================
Files 19 19
Lines 2681 2683 +2
Branches 687 687
==========================================
+ Hits 2069 2071 +2
Misses 409 409
Partials 203 203
Continue to review full report at Codecov.
|
952aeef
to
38538e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To me, this looks good. However, I would still like a confirmation from related bug issue that it solves the problem.
@sky-joker can you rebase please? Do you think we can merge without confirmation from the related issue? Would like to get this into 1.2.0 also |
38538e1
to
baddbab
Compare
rebase done :) |
After testing this myself with English/Non-English words and Python2.7/3.8 both with and without this patch I confirm it is working as inteded. Good job @sky-joker ! Very nice and clean patch |
Thank you @D3DeFi ! |
This is breaking one of my templates. I have a json template with removing the |
Here is an example template that I'm trying to import that fails.
|
SUMMARY
This PR is to fix to decode Unicode Escape of multibyte strings in an importing template content.
If using Python2, this module hasn't decoded Unicode Escape until now.
Exporting template data with this module (or zabbix_template_info) and a copy module creates a file with multibyte strings encoded as a byte string (Unicode Escape).
So, a garbled text occurs(byte strings) on Zabbix after to import using that.
This issue only occurs in Python2.
fixes: #225
ISSUE TYPE
COMPONENT NAME
plugins/modules/zabbix_template.py
ADDITIONAL INFORMATION