On Sat, Aug 25, 2012 at 3:51 AM, Rene Maurer <[email protected]> wrote:
> On 08/25/2012 at 00:08 C Anthony Risinger <[email protected]> wrote:
>> On Thu, Aug 23, 2012 at 6:42 AM, Rene Maurer <[email protected]>
>> wrote:
>
>>> This one doesn't:
>>>   tb = TextBox()
>>>   tb.setText(u"öäüéàè")
>>>
>>> => File
>>> "/home/rene/Local/python/pyjs/pyjs/library/pyjamas/ui/TextBoxBase.py",
>>> line 113, in setText DOM.setAttribute(self.getElement(), "value",
>>> str(text)) UnicodeEncodeError: 'ascii' codec can't encode
>>> characters in position 0-11: ordinal not in range(128)
>>>
>>> This one works again:
>>>   tb = TextBox()
>>>   tb.setText(u"öäüéàè".encode("utf-8"))
>
>> does this work in other runners? like the pywebkitgtk one?
>
> Sorry I don't have a running pywebkitgtk version available right now. I
> can test Reit next week.

no worries -- i am near positive it won't make any difference -- don't
bother :-)

>> ... shows very few places this is done; i think it would be OK to drop
>> the str() call here.  can you verify removing the call to str() works
>> fine?
>
> I have modified  ' library/pyjamas/ui/TextBoxBase.py:'
>
> def setText(self, text):
>    # -OLD- DOM.setAttribute(self.getElement(), "value", str(text))
>    DOM.setAttribute(self.getElement(), "value", text)
>
> Of course this works. IMHO it doesn't make sense to replace the other
> calls to str()...

yeah, i just meant "there doesn't appear to be a precedence of
converting to str()" ... i only intended on changing the one instance
affecting you (which i will do here in about 5 minutes, btw).

>>> python2 Desktop.py
>>> Traceback (most recent call last):
>>>   File "Desktop.py", line 8, in <module>
>>>     import pyjd
>>>   File "/usr/lib/python2.7/site-packages/pyjd/__init__.py", line 5,
>>> in <module> from pyjs.runners import RunnerManager
>>> ImportError: No module named runners
>>>
>>> "import pyjd" is the very first statement in Desktop.py. I have
>>> cleaned everything and installed from scratch. So maybe I have just
>>> forgotten something.
>>
>> have you installed from a recent build?
>
> git clone https://github.com/pyjs/pyjs.git
> git checkout feature/giwebkit
>
> Still the same (no problem at all for me right now).

just to be clear: you've checkout out the `giwebkit` branch, then
installed to your system? can you just paste the commands here? (i've
never actually installed pyjs with pip/easy_install)

your error implies the `pyjs` package exists, and only the `runners`
package is missing suggesting perhaps an incomplete install.  if you
can paste the commands used for a system install, this might be a good
time for me to try and fix the pypi package too.

lastly, do either of these files exist?

/usr/lib/python2.7/site-packages/pyjs/__init__.py
/usr/lib/python2.7/site-packages/pyjs/runners/__init__.py

thanks René!

-- 

C Anthony

-- 



Reply via email to