[Tutor] Encode problem

Kent Johnson kent37 at tds.net
Fri May 1 21:55:25 CEST 2009


On Fri, May 1, 2009 at 2:19 PM, Pablo P. F. de Faria
<pablofaria at gmail.com> wrote:
> Hi, all. I need some help.
>
> I'm trying to save a configuration file, using ConfigParser. The code
> is the following:
>
> self.cfg.write(codecs.open(self.properties_file,'w','utf-8'))
>
> As one can see, the character encoding is explicitly UTF-8. But
> ConfigParser keeps trying to save it as a 'ascii' file and gives me
> error for directory-names containing >128 code characters (like "Á").
> It is just a horrible thing to me, for my app will be used mostly by
> brazillians.

What is the exact error and stack trace you get? What directory name
is the problem? Is it the directory where you are saving the file or a
directory name that is in the configuration data?

Kent


More information about the Tutor mailing list