enthought / enthought/traitsui

TraitsUI halves odd numbers: TraitError: The 'top' trait of an ImageSlice instance must be an integer (wxPython 4 experiment)

Open
#580 5 comments 0 reactions 0 assignees View on GitHub
priority: low toolkit: WxPython4
Dominant language
Python
Stars
306
Forks
99
PR merge metrics
No merged PRs in 30d

Description

For experimenting with the wxPython4.0 backend under Python 3 I've rebased locally enthought/pyface/pull/287 and adopted a similar approach to porting `traitsui` to wxPython4.0

It works for me now, and the popping deprecation warnings of various nature were more or less successfully traced down and so far resolved (or I think so). One I couldn't deal with, however, requires a deeper analysis:

``` python
Exception occurred in traits notification handler.
Please check the log file for details.
Exception occurred in traits notification handler for object: , trait: image, old value: None, new value:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/traits/trait_notifiers.py", line 394, in __call__
self.handler(*args)
File "/usr/lib/python3/dist-packages/traitsui/wx/image_slice.py", line 244, in _image_changed
self._analyze_bitmap()
File "/usr/lib/python3/dist-packages/traitsui/wx/image_slice.py", line 258, in _analyze_bitmap
data = reshape(fromstring(image.GetData(), uint8), (dy, dx, 3))
TypeError: fromstring() argument 1 must be read-only bytes-like object, not bytearray
```

I would appreciate somebody looking at the relevant code base and, possibly, analyse it Python3-compatibility. I was testing the backend it with: https://docs.enthought.com/mayavi/mayavi/mlab.html

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.