PyAssertionError after upgrade to 2.8.10 ?

Hello again,

Hello All,

Today i started using 2.8.10.1 after developing under 2.8.9.1
My application uses TaskBarIcon, until now without problems.

On the first startup after the upgrade to 2.8.10 I got this
PyAssertionError when the TaskBarIcon calls SetIcon:

Traceback (most recent call last):
     ...
       ...
     self.SetIcon(self.icon, _("Connected"))
   File "/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/
_windows.py", line 2169, in SetIcon
     return _windows_.TaskBarIcon_SetIcon(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "image.HasMask()" failed
at ../src/common/rgncmn.cpp(134) in Union(): wxBitmap::ConvertToImage
doesn't preserve mask?

I tried several images, image formats, and images with and without
mask. However, the error remains.
My application works as it should, so it is not a show stopper, but I
would really like to see the error go away. :slight_smile:

Any thoughts on this one?
Has anyone had a similar problem?

Which platform? From the path names in the traceback I'm guessing some
*nix, but it's always good to mention it specifically. Please send a
sample image that is causing this problem for you, and a small sample
application would be helpful too.

--
Robin Dunn
Software Craftsman
http://wxPython.org

Ok, attached is a tarball with an exmple as I pruned it from my application. It runs and produces the PyAssertionError of my original question. Also in the tarball is a .ico file that the example uses as a TaskBarIcon.

Remove any other line in the example and the error no longer occurs.

The example basically does nothing else than open an empty frame and place an icon on the taskbar and the frame. Without the threading however, i was not able to reproduce the error.

Can anyone reproduce the error with this example?
What is happening here?

We are running this example on a system with:
Fedora Core 10
kernel: 2.6.27.37-170.2.104.fc10.i686.PAE
Gnome 2.24.3
python 2.5.2
wx 2.8.10.1

Many thanks,
Maarten Stol

ps: for those of you that may not know, you can extract the tarball with the tar command: tar -xvzf example.tar.gz

example.tar.gz (14.2 KB)

Maarten,

Maarten Stol wrote:

Hello again,

Hello All,
      Today i started using 2.8.10.1 after developing under 2.8.9.1
My application uses TaskBarIcon, until now without problems.
      On the first startup after the upgrade to 2.8.10 I got this
PyAssertionError when the TaskBarIcon calls SetIcon:
      Traceback (most recent call last):
     ...
       ...
     self.SetIcon(self.icon, _("Connected"))
   File "/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/
_windows.py", line 2169, in SetIcon
     return _windows_.TaskBarIcon_SetIcon(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "image.HasMask()" failed
at ../src/common/rgncmn.cpp(134) in Union(): wxBitmap::ConvertToImage
doesn't preserve mask?
      I tried several images, image formats, and images with and without
mask. However, the error remains.
My application works as it should, so it is not a show stopper, but I
would really like to see the error go away. :slight_smile:
      Any thoughts on this one?
Has anyone had a similar problem?
      

Which platform? From the path names in the traceback I'm guessing some
*nix, but it's always good to mention it specifically. Please send a
sample image that is causing this problem for you, and a small sample
application would be helpful too.

--
Robin Dunn
Software Craftsman
http://wxPython.org
    
Ok, attached is a tarball with an exmple as I pruned it from my application. It runs and produces the PyAssertionError of my original question. Also in the tarball is a .ico file that the example uses as a TaskBarIcon.

Remove any other line in the example and the error no longer occurs.

The example basically does nothing else than open an empty frame and place an icon on the taskbar and the frame. Without the threading however, i was not able to reproduce the error.

Can anyone reproduce the error with this example?
  

I am on Windows 7 with:
# Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]
# wxPython 2.8.10.1, Boa Constructor 0.6.1

And don't see the error.

What about if you add this to your OnClose:

    def OnCloseWindow(self, event):
        if self.tbicon is not None:
            self.tbicon.Destroy()

Werner

It's working as expected on Ubintu with 2.8.10.1 for me. Are you sure you're running 2.8.10.1 and that there isn't an older version being imported by mistake? From the traceback and your comments in the code for what lines could be removed I would suspect that the Scale method is loosing the Mask in the original image[1]. Scale is generic code so it should not have any differences across platforms, so the only thing left is that you're running a different version of wx than I am.

[1] To verify this you can add a "print img.HasMask()" before and after the call to Scale.

···

On 11/26/09 6:34 AM, Maarten Stol wrote:

Traceback (most recent call last):
      ...
        ...
      self.SetIcon(self.icon, _("Connected"))
    File "/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/
_windows.py", line 2169, in SetIcon
      return _windows_.TaskBarIcon_SetIcon(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "image.HasMask()" failed
at ../src/common/rgncmn.cpp(134) in Union(): wxBitmap::ConvertToImage
doesn't preserve mask?

Ok, attached is a tarball with an exmple as I pruned it from my
application. It runs and produces the PyAssertionError of my original
question. Also in the tarball is a .ico file that the example uses as a
TaskBarIcon.

Remove any other line in the example and the error no longer occurs.

The example basically does nothing else than open an empty frame and
place an icon on the taskbar and the frame. Without the threading
however, i was not able to reproduce the error.

Can anyone reproduce the error with this example?
What is happening here?

We are running this example on a system with:
Fedora Core 10
kernel: 2.6.27.37-170.2.104.fc10.i686.PAE
Gnome 2.24.3
python 2.5.2
wx 2.8.10.1

--
Robin Dunn
Software Craftsman

Ok, interesting :slight_smile:

Scale is not loosing the mask, tested this with "print img.HasMask()"
before and after the call to Scale. Also, the wx version really is
2.8.10.1, tested this with "print wx.__version__" in the init.

What might be the case, is that the problem crept in when I compiled
wx from source for my Fedora machine. A colleague made some hacks with
rpmbiuld when we did this, i am not sure what since i am not familiar
with that process.

I will try to do the same thing on an ubuntu machine with the original
wx packages for ubuntu, and see what happens.

Thanks,
Maarten Stol

···

On Nov 26, 7:13 pm, Robin Dunn <ro...@alldunn.com> wrote:

On 11/26/09 6:34 AM, Maarten Stol wrote:

>>> Traceback (most recent call last):
>>> ...
>>> ...
>>> self.SetIcon(self.icon, _("Connected"))
>>> File "/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/
>>> _windows.py", line 2169, in SetIcon
>>> return _windows_.TaskBarIcon_SetIcon(*args, **kwargs)
>>> wx._core.PyAssertionError: C++ assertion "image.HasMask()" failed
>>> at ../src/common/rgncmn.cpp(134) in Union(): wxBitmap::ConvertToImage
>>> doesn't preserve mask?

> Ok, attached is a tarball with an exmple as I pruned it from my
> application. It runs and produces the PyAssertionError of my original
> question. Also in the tarball is a .ico file that the example uses as a
> TaskBarIcon.

> Remove any other line in the example and the error no longer occurs.

> The example basically does nothing else than open an empty frame and
> place an icon on the taskbar and the frame. Without the threading
> however, i was not able to reproduce the error.

> Can anyone reproduce the error with this example?
> What is happening here?

> We are running this example on a system with:
> Fedora Core 10
> kernel: 2.6.27.37-170.2.104.fc10.i686.PAE
> Gnome 2.24.3
> python 2.5.2
> wx 2.8.10.1

It's working as expected on Ubintu with 2.8.10.1 for me. Are you sure
you're running 2.8.10.1 and that there isn't an older version being
imported by mistake? From the traceback and your comments in the code
for what lines could be removed I would suspect that the Scale method is
loosing the Mask in the original image[1]. Scale is generic code so it
should not have any differences across platforms, so the only thing left
is that you're running a different version of wx than I am.

[1] To verify this you can add a "print img.HasMask()" before and after
the call to Scale.

--
Robin Dunn
Software Craftsmanhttp://wxPython.org