Modify

Ticket #549 (closed defect: fixed)

Opened 14 years ago

Last modified 7 years ago

utf8 strings in ConfigFile elements causes them to fail

Reported by: peter@… Owned by: desai
Priority: major Milestone:
Component: bcfg2-client Version:
Keywords: Cc:

Description

I've tried using both Cfg and TGenshi to do this, so I think it's generalizable to ConfigFiles? in general, but drop any of äöüÄÖÜ (utf8 c3a4 c3b6 c3bc c384 c396 c39c c39f, at least) into a config file and it will barf:

Unexpected failure in BindStructure: ConfigFile /etc/apache2/sites-include/phpmy
faq
Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/Bcfg2/Server/Core.py", line 268, in BindStructure
    self.Bind(entry, metadata)
  File "/usr/lib/python2.4/site-packages/Bcfg2/Server/Core.py", line 298, in Bind
    return glist[0].Entries[entry.tag][entry.get('name')](entry, metadata)
  File "/usr/lib/python2.4/site-packages/Bcfg2/Server/Plugin.py", line 564, in bind_entry
    return aspec[0].bind_entry(entry, metadata)
  File "/usr/lib/python2.4/site-packages/Bcfg2/Server/Plugins/TGenshi.py", line 45, in bind_entry
    entry.text = stream.render('text')
  File "etree.pyx", line 845, in etree._Element.text.__set__
  File "apihelpers.pxi", line 279, in etree._setNodeText
  File "apihelpers.pxi", line 497, in etree._utf8
AssertionError: All strings must be Unicode or ASCII

Attachments

unicode_support.diff (5.5 KB) - added by stousignant@… 13 years ago.
suggested patch to resolve the utf-8 encoding
unicode_supportv2.diff (11.7 KB) - added by stousignant@… 13 years ago.
2nd version of the patch, with better support of xml encoding and header
unicode-supportv3.diff (19.4 KB) - added by stousignant@… 13 years ago.
This version of the patch lets you configure the input and output encoding of all config files at once. The options defaut to python sys.getdefaultencoding.

Change History

comment:1 Changed 13 years ago by stousignant@…

Would it be better if we juste push the encoding to system default, to what i could see everything is us-ascii and localised comments tend to break. Somehow, every xml file that bcfg2 generate is missing the header " <?xml version="1.0"?> ", is there any reason for this ???

Changed 13 years ago by stousignant@…

suggested patch to resolve the utf-8 encoding

Changed 13 years ago by stousignant@…

2nd version of the patch, with better support of xml encoding and header

Changed 13 years ago by stousignant@…

This version of the patch lets you configure the input and output encoding of all config files at once. The options defaut to python sys.getdefaultencoding.

comment:2 Changed 13 years ago by desai

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone set to Bcfg2 0.9.6 Release

unicode-supportv3.diff was committed in [e32bbfbca5233d4ad7a5bee74698d614ff0b1f24] (SVN r4731).

comment:3 Changed 7 years ago by Richardheef

  • Milestone Bcfg2 0.9.6 Release deleted

There was also scoring in the scientific day. [https://my.swu.edu/ICS/icsfs/tabfen64.html?target=29d1159c-fc86-4cea-922f-05a7d615c1d9 phentermine side effects long term - Image shafts depend upon food, profile, pressure wall, weight and medical battlecruisers.

comment:4 Changed 7 years ago by Richardheef

Oral to the fat paint is the self-harming that dose grandees interact with every clear solution in their french access. [https://my.swu.edu/ICS/icsfs/tabfen57.html?target=b9818bc9-64ad-4082-9836-ccd77c24e965 phentermine long term effects - The exercises are shaded from buy phentermine 37.5 mg from thus.

WARNING! You need to establish a session before you can create or edit tickets. Otherwise the ticket will get treated as spam.

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.