Re: ZConfig and accentuated (no ASCII) characters with python 2.7 under windows 10

Cyril Giraudon <[email protected]> Thu, 4 Oct 2018 00:29:32 -0700 (PDT)
Newsgroups gmane.comp.web.zope.zodb
Message-ID <[email protected]>
Done.
https://github.com/zopefoundation/ZConfig/issues/37

Cyril.


Le mercredi 3 octobre 2018 17:42:47 UTC+2, Tres Seaver a écrit :
>
> On 10/03/2018 05:56 AM, Cyril Giraudon wrote: 
>
> > I use Python 2.7 and ZEO 4.2.0 under a French Windows 10. 
> > 
> > I needed to use a path with an accentuated character in the filestorage 
> > bracket of the ZEO config file: 
> > 
> > <zeo> 
> >   address localhost:23914 
> > </zeo> 
> > <eventlog> 
> >   level INFO 
> >   <logfile> 
> >      path c:\path\to\log\server-23914.log 
> >   </logfile> 
> > </eventlog> 
> > <filestorage 1> 
> >   path C:/path/to/test/NETTOPé\data.fs 
> > </filestorage> 
> > 
> > After several attempts with ("utf-8", "iso-8859-1"), I always obtain the 
> > following error: 
> > 
> >> python -m ZEO.runzeo -C .\zeo.conf 
> > ... 
> > ... 
> >   File 
> > 
> "c:\users\cyril\dev\projects\cablesim\envs\adk-2-bw\python27\lib\site-packages\ZConfig\loader.py", 
>
> > line 230, in openResource 
> >     data = file.read().decode() 
> > UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 
> 254: 
> > ordinal not in range(128) 
> > 
> > Finally, this seems logical, since the default encoding of the decode 
> > method in python 2.7 is ascii. 
> > 
> > So, I 'd like to know if any workaround exist or if I have to forbid no 
> > ascii path ? 
>
> I'd say this is a bug:  the `openPackageResource` method passes an 
> explicit 
> `utf-8` encoding to `decode()`.  Please report it here: 
>
>   https://github.com/zopefoundation/ZConfig/issues/new 
>
>
> Tres. 
> -- 
> =================================================================== 
> Tres Seaver          +1 540-429-0999          [email protected] 
> <javascript:> 
> Palladion Software   "Excellence by Design"    http://palladion.com 
>
>

-- 
You received this message because you are subscribed to the Google Groups "zodb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.