Chris,
Chris Mellon wrote:
Hi Robin,
Robin Dunn wrote:
A user of mine is seeing this error, he thinks it happens when he is
pasting something but I can't recreate it.
**** Mon Nov 12 13:24:44 2007 ****
Traceback (most recent call last):
File "wx\lib\masked\maskededit.pyo", line 5524, in _OnKillFocus
File "wx\lib\masked\maskededit.pyo", line 4270, in _AdjustField
File "wx\lib\masked\textctrl.pyo", line 164, in _SetValue
File "wx\_controls.pyo", line 1709, in SetValue
PyAssertionError: C++ assertion "ucf.GotUpdate() || ( !HasSelection()
&& value.empty() )" failed at ..\..\src\msw\textctrl.cpp(965) in
wxTextCtrl::StreamIn(): EM_STREAMIN didn't send EN_UPDATE?
I wonder if anyone has an idea what might cause this.
This is wxPython 2.8.4.2 ANSI.
Yes, we've seen this before. Unfortunately I don't remember the
details, nor what the workaround was...
You obviously have a much better memory then I do. It was me who
reported this before and I entered a tracker item (1748230) for it upon
your request, but I don't see any action on it and I can't find any work
around for it.
C++ syntax is not my forte, could you please explain what the assertion
is checking for, so I can try to catch is in my code.
Tranaslated to python, this would read:
assert ucf.GotUpdate() and ((not self.HasSelection()) and value == "")
This is apparently checking some details of the win32 text stream
protocol: wx uses the win32 rich text stream api to insert text into
the control, but the control is not firing the expected update events.
This code path shouldn't be taken for pasting in most cases - it looks
like it's happening because:
I am not sure but I thought that maskedit is doing a "special" setvalue for Paste.
a) you're not in a unicode build and
correct, I am moving to a Unicode build but it will take some time as I want to change the db backend to Unicode at the same time.
b) the font being used isn't in the system encoding (or isn't being
detected as such) and
Finally, I can recreate it. I went to get some text from some website in a font I definitely don't have on my system and when I paste this into a field I see the error.
Now I just need to find a work around.
c) The text control is has the wx.TE_RICH (or TE_RICH2) style.
Yeap, I use TE_RICH2
If you change any one of those things, this code path shouldn't be
taken and you shouldn't see this assert.
Thanks for the tips.
Werner
···
On Nov 13, 2007 4:37 AM, Werner F. Bruhin <werner.bruhin@free.fr> wrote:
wbruhin@free.fr wrote:
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
If you could file a bug (or update your original one) with some
information about this including a test case that'd be great.
···
On Nov 13, 2007 8:48 AM, Werner F. Bruhin <werner.bruhin@free.fr> wrote:
Chris,
Chris Mellon wrote:
> On Nov 13, 2007 4:37 AM, Werner F. Bruhin <werner.bruhin@free.fr> wrote:
>
>> Hi Robin,
>>
>> Robin Dunn wrote:
>>
>>> wbruhin@free.fr wrote:
>>>
>>>> A user of mine is seeing this error, he thinks it happens when he is
>>>> pasting something but I can't recreate it.
>>>>
>>>> **** Mon Nov 12 13:24:44 2007 ****
>>>> Traceback (most recent call last):
>>>> File "wx\lib\masked\maskededit.pyo", line 5524, in _OnKillFocus
>>>> File "wx\lib\masked\maskededit.pyo", line 4270, in _AdjustField
>>>> File "wx\lib\masked\textctrl.pyo", line 164, in _SetValue
>>>> File "wx\_controls.pyo", line 1709, in SetValue
>>>> PyAssertionError: C++ assertion "ucf.GotUpdate() || ( !HasSelection()
>>>> && value.empty() )" failed at ..\..\src\msw\textctrl.cpp(965) in
>>>> wxTextCtrl::StreamIn(): EM_STREAMIN didn't send EN_UPDATE?
>>>>
>>>> I wonder if anyone has an idea what might cause this.
>>>>
>>>> This is wxPython 2.8.4.2 ANSI.
>>>>
>>> Yes, we've seen this before. Unfortunately I don't remember the
>>> details, nor what the workaround was...
>>>
>> You obviously have a much better memory then I do. It was me who
>> reported this before and I entered a tracker item (1748230) for it upon
>> your request, but I don't see any action on it and I can't find any work
>> around for it.
>>
>> C++ syntax is not my forte, could you please explain what the assertion
>> is checking for, so I can try to catch is in my code.
>>
>>
>
> Tranaslated to python, this would read:
> assert ucf.GotUpdate() and ((not self.HasSelection()) and value == "")
>
> This is apparently checking some details of the win32 text stream
> protocol: wx uses the win32 rich text stream api to insert text into
> the control, but the control is not firing the expected update events.
>
> This code path shouldn't be taken for pasting in most cases - it looks
> like it's happening because:
>
I am not sure but I thought that maskedit is doing a "special" setvalue
for Paste.
> a) you're not in a unicode build and
>
correct, I am moving to a Unicode build but it will take some time as I
want to change the db backend to Unicode at the same time.
> b) the font being used isn't in the system encoding (or isn't being
> detected as such) and
>
Finally, I can recreate it. I went to get some text from some website
in a font I definitely don't have on my system and when I paste this
into a field I see the error.
Now I just need to find a work around.
> c) The text control is has the wx.TE_RICH (or TE_RICH2) style.
>
Yeap, I use TE_RICH2
> If you change any one of those things, this code path shouldn't be
> taken and you shouldn't see this assert.
>
Chris,
Chris Mellon wrote:
...
If you could file a bug (or update your original one) with some
information about this including a test case that'd be great.
It seems also have something to do with using wx.TE_AUTO_URL style, but I still can't reproduce it at will, although it does happen quit often.
I'll try to create a test case today.
Werner