Re: About Boa constructor 0.6.1
"Werner F. Bruhin" <[email protected]>
| Newsgroups | gmane.comp.ide.boa-constructor.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Ianaré,
ianaré sévi wrote:
> I had to do some stuff in windows and am getting an ecoding problem.
> We've had a lot of those of late, and I wanted to see if anything
> could be done.
>
> WinXP home , wxpython 2.8 unicode, latest boa from CVS.
>
> My home directory is : "C:\Documents and Settings\ianaré"
> (will my accent aigu comme out properly in your e-mails ? )
>
Yeap, I can see it fine.
> On load, Boa borks with :
>
> importing Inspector
> Traceback (most recent call last):
> File "Boa.py", line 711, in <module>
> main()
> File "Boa.py", line 693, in main
> app = BoaApp()
> File "Boa.py", line 497, in __init__
> wx.App.__init__(self, False)
> File "C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 7823
> , in __init__
> self._BootstrapApp()
> File "C:\Python25\Lib\site-packages\wx-2.8-msw-unicode\wx\_core.py", line 7420
> , in _BootstrapApp
> return _core_.PyApp__BootstrapApp(*args, **kwargs)
> File "Boa.py", line 540, in OnInit
> inspector = Inspector.InspectorFrame(self.main)
> File "C:\Python25\Lib\site-packages\boa-constructor\Inspector.py",
> line 157, in __init__
> cmpInf.append(self.paletteImages.Add(IS.load(filename)))
> File "C:\Python25\Lib\site-packages\boa-constructor\ImageStore.py",
> line 78, in load
> imgpath, ext = self.pathExtFromName(rootpath, name)
> File "C:\Python25\Lib\site-packages\boa-constructor\ImageStore.py",
> line 69, in pathExtFromName
> self.checkPath(imgPath)
> File "C:\Python25\Lib\site-packages\boa-constructor\ImageStore.py",
> line 98, in checkPath
> raise InvalidImgPathError, _('%s not valid') %imgPath
> UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 31: ordinal
> not in range(128)
>
> -----------------------------------------------------
>
>
> I fixed this by editing "ImageStore.py" like so :
>
>
> def pathExtFromName(self, root, name):
> root = root.decode(sys.getfilesystemencoding())
> imgPath = self.canonizePath(os.path.join(root, name))
> ext = os.path.splitext(name)[1]
> self.checkPath(imgPath)
> return imgPath, ext
>
>
> ".decode(sys.getfilesystemencoding())" is what I use in my
> applications to handle this sort of problem.
>
I have to remember this one for my own stuff, also I always thought that
Python/wxPython would handle these cases.
What versions are you currently using?
Werner
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Boa-constructor-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boa-constructor-users